A data processing method and apparatus
Patent Information
- Application Number
- CN202210090556.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-24
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-01-24
AI Technical Summary
[0016]In this application, attribute features of multiple basic attributes related to logistics attributes of the logistics object are obtained based on the object description information of the logistics object. Relevance features, representing the correlation between each attribute feature and each candidate logistics attribute among multiple candidate logistics attributes, are obtained. For any one of the multiple basic attributes, at least based on the attribute features of the multiple basic attributes, the attention features of the associated basic attributes on that basic attribute are obtained, thus obtaining the attention features corresponding to that basic attribute. Based on the correlation features and the attention features corresponding to each of the multiple basic attributes, the logistics attribute of the logistics object is determined from the multiple candidate logistics attributes.
Smart Images

Figure CN116542583B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of logistics technology, and in particular to a data processing method and apparatus. Background Technology
[0002] With the rapid development of technology, more and more users are buying goods online. When users purchase goods through e-commerce platforms, merchants can create logistics orders and send them to the logistics system. The logistics system then packages and delivers the goods to the user based on the logistics order, so that the user receives the purchased goods.
[0003] Each commodity has its own logistical attributes, such as restrictions on transport, applicable tariffs, and whether it is fragile or prone to leakage. The restrictions on transport, tariffs, and the likelihood of breakage or leakage often differ between commodities.
[0004] The logistics system creates logistics solutions for goods based on the prohibited or restricted transport requirements of the goods in the logistics order, the applicable taxes of the goods, and the logistics attributes such as whether the goods are fragile or prone to loss. These solutions can include the packaging materials, packaging methods, and delivery methods of the goods. The system then delivers the goods based on these logistics solutions.
[0005] In addition, in accordance with relevant regulations, relevant departments will verify and inspect the goods in the package. For example, during the customs clearance process, it is necessary to check the tax payment status of the goods, during the customs clearance process, it is necessary to check the name of the category to which the goods belong, and the trunk line and port will conduct security checks on the package.
[0006] Therefore, identifying the logistics attributes of goods is of great significance in ensuring that goods can reach users safely and quickly. Summary of the Invention
[0007] This application discloses a data processing method and apparatus.
[0008] In a first aspect, this application discloses a method for identifying logistics attributes, the method comprising: obtaining attribute features of multiple basic attributes related to logistics attributes of a logistics object based on object description information of the logistics object; obtaining correlation features to characterize the correlation between the attribute features of each basic attribute and each candidate logistics attribute among multiple candidate logistics attributes; and, for any one of the multiple basic attributes, obtaining, at least based on the attribute features of the multiple basic attributes, attention features of the associated basic attributes of the basic attribute on the basic attribute, thereby obtaining attention features corresponding to the basic attribute; and determining the logistics attribute of the logistics object among the multiple candidate logistics attributes based on the correlation features and the attention features corresponding to each basic attribute.
[0009] Secondly, this application discloses a method for training a logistics attribute recognition model. The method includes: acquiring at least one sample dataset, the sample dataset including: sample object description information of sample logistics objects and labeled logistics attributes of the sample logistics objects; creating a network structure for a logistics attribute recognition model; training the network parameters in the logistics attribute recognition model using the sample dataset until the network parameters converge, thereby obtaining the logistics attribute recognition model; wherein, the network structure includes at least an attribute feature extraction network, a relevance feature extraction network, an attention feature extraction network, and a logistics attribute determination network; the attribute feature extraction network is used to obtain sample attribute features of multiple basic sample attributes related to logistics attributes of the sample logistics objects based on the sample object description information of the sample logistics objects. The relevance feature extraction network is used to obtain sample relevance features, which characterize the relevance between sample attribute features representing the basic attributes of each sample and each candidate logistics attribute among multiple candidate logistics attributes; the attention feature extraction network is used, for any sample basic attribute among the multiple sample basic attributes, to obtain the sample attention features of the sample association basic attributes on the sample basic attribute, based at least on the sample attribute features of the multiple sample basic attributes, to obtain the sample attention features corresponding to the sample basic attribute; the logistics attribute determination network is used to determine the logistics attribute of the sample logistics object among the multiple candidate logistics attributes based on the sample relevance features and the sample attention features corresponding to each sample basic attribute among the multiple sample basic attributes.
[0010] Thirdly, this application discloses an apparatus for identifying logistics attributes, the apparatus comprising: a first acquisition module, configured to acquire attribute features of multiple basic attributes related to logistics attributes of a logistics object based on object description information of the logistics object; a second acquisition module, configured to acquire correlation features characterizing the correlation between the attribute features of each basic attribute and each candidate logistics attribute among multiple candidate logistics attributes; a third acquisition module, configured to, for any one of the multiple basic attributes, acquire, at least based on the attribute features of the multiple basic attributes, attention features of the associated basic attributes on the basic attribute, thereby obtaining attention features corresponding to the basic attribute; and a determination module, configured to determine the logistics attribute of the logistics object among the multiple candidate logistics attributes based on the correlation features and the attention features corresponding to each basic attribute.
[0011] Fourthly, this application discloses an apparatus for training a logistics attribute recognition model, the apparatus comprising: a fourth acquisition module for acquiring at least one sample dataset, the sample dataset including: sample object description information of sample logistics objects and labeled logistics attributes of the sample logistics objects; a creation module for creating a network structure of a logistics attribute recognition model; and a training module for training the network parameters in the logistics attribute recognition model using the sample dataset until the network parameters converge to obtain the logistics attribute recognition model; wherein the network structure includes at least an attribute feature extraction network, a relevance feature extraction network, an attention feature extraction network, and a logistics attribute determination network; the attribute feature extraction network is used to acquire multiple samples related to the logistics attributes of the sample logistics objects based on the sample object description information of the sample logistics objects. The basic attribute sample attribute features; the relevance feature extraction network is used to obtain sample relevance features that characterize the relevance between the sample attribute features of each sample basic attribute and each candidate logistics attribute among multiple candidate logistics attributes; the attention feature extraction network is used, for any sample basic attribute among the multiple sample basic attributes, to obtain the sample attention features of the sample association basic attributes on the sample basic attribute, based at least on the sample attribute features of the multiple sample basic attributes, to obtain the sample attention features corresponding to the sample basic attribute; the logistics attribute determination network is used to determine the logistics attribute of the sample logistics object among the multiple candidate logistics attributes based on the sample relevance features and the sample attention features corresponding to each sample basic attribute among the multiple sample basic attributes.
[0012] Fifthly, this application discloses an electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the methods shown in any of the foregoing aspects.
[0013] Sixthly, this application discloses a non-transitory computer-readable storage medium that, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the methods shown in any of the foregoing aspects.
[0014] In a seventh aspect, this application discloses a computer program product in which, when the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to perform the methods shown in any of the foregoing aspects.
[0015] Compared with the prior art, this application has the following advantages:
[0016] In this application, attribute features of multiple basic attributes related to logistics attributes of the logistics object are obtained based on the object description information of the logistics object. Relevance features, representing the correlation between each attribute feature and each candidate logistics attribute among multiple candidate logistics attributes, are obtained. For any one of the multiple basic attributes, at least based on the attribute features of the multiple basic attributes, the attention features of the associated basic attributes on that basic attribute are obtained, thus obtaining the attention features corresponding to that basic attribute. Based on the correlation features and the attention features corresponding to each of the multiple basic attributes, the logistics attribute of the logistics object is determined from the multiple candidate logistics attributes.
[0017] In this application, by obtaining the correlation characteristics between the attribute features of each basic attribute of the logistics object and each candidate logistics attribute among multiple candidate logistics attributes, the contribution degree of each attribute feature of the logistics object to each candidate logistics attribute can be obtained. For example, the attribute feature "milk" of the basic attribute "category" contributes more to the candidate logistics attribute "leaky", and the attribute feature "battery" of the basic attribute "category" contributes more to the candidate logistics attributes "flammable" and "explosive", etc. In this way, by knowing the contribution degree of each attribute feature of the logistics object to each candidate logistics attribute, the accuracy of identifying the logistics attributes of the logistics object can be improved, and the interpretability of the identified logistics attributes can also be improved.
[0018] Secondly, the attention mechanism can acquire topological information about the relationships between the attribute features of multiple basic attributes of a logistics object. This topological information can capture the relational features between related basic attribute features, thus enriching the features used to identify the logistics attributes of the object and improving the accuracy of attribute identification. Furthermore, the attention mechanism can determine the importance of the relational features between different basic attribute features. This importance can distinguish between important and unimportant relationships; for example, it can focus more on important relationships and suppress unimportant ones to highlight more critical features, thereby improving the accuracy of logistics attribute identification. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the steps of a method for training a logistics attribute recognition model according to this application.
[0020] Figure 2 This is a schematic diagram of the structure of a logistics attribute identification model according to this application.
[0021] Figure 3 This is a schematic diagram of the structure of a logistics attribute identification model according to this application.
[0022] Figure 4 This is a schematic diagram of the structure of a logistics attribute identification model according to this application.
[0023] Figure 5 This is a flowchart of the steps of a method for identifying logistics attributes according to this application.
[0024] Figure 6 This is a structural block diagram of a device for identifying logistics attributes according to this application.
[0025] Figure 7 This is a structural block diagram of a device for training a logistics attribute recognition model according to this application.
[0026] Figure 8 This is a structural block diagram of a device according to this application. Detailed Implementation
[0027] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, this application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0028] In one approach, in order to identify the logistics attributes of a logistics object, the logistics attribute information of the logistics object can be manually labeled.
[0029] For example, when the sender of a shipment submits a logistics order to the logistics system, they can manually identify the shipment's logistics attributes and manually input these attributes into the system. In subsequent logistics operations involving the shipment, if the required logistics attributes are needed, the sender can directly retrieve these manually entered attributes from the logistics system.
[0030] Alternatively, after the sender of a shipment submits a logistics order to the logistics system, the logistics system staff can manually identify the logistics attributes of the shipment and manually add these attributes to the logistics order. In subsequent logistics operations involving the shipment, if the logistics attributes are needed, the manually added attributes can be directly retrieved from the logistics system.
[0031] However, the inventors discovered that the number of logistics orders that a logistics system needs to process is often massive. Therefore, manually labeling the logistics attribute information of logistics objects requires a huge number of staff and involves a large amount of labeling work, resulting in high labor costs.
[0032] Therefore, the need to reduce labor costs in scenarios involving the identification of logistics attributes of logistics objects is proposed.
[0033] In order to reduce labor costs in the scenario of identifying the logistics attributes of logistics objects, another approach is to use models to identify the logistics attributes of logistics objects.
[0034] For example, the model can be trained in advance, for instance, by manually collecting multiple sample data. For any sample data, the sample data includes the name of a sample logistics object and the manually labeled logistics attributes of that sample logistics object. The same applies to each other sample data.
[0035] Then, multiple sample data can be used to train the model until the parameters in the model converge, thus completing the training of the model.
[0036] The trained model can then be deployed online. When it is necessary to obtain the logistics attributes of a logistics object, the name of the logistics object can be input into the model so that the model processes the name of the logistics object and obtains the logistics attributes of the logistics object.
[0037] However, after analyzing the above methods, the inventors found that the accuracy of identifying the logistics attributes of logistics objects using models is low.
[0038] If the accuracy of identifying the logistics attributes of a logistics object is low, the logistics solution created for the logistics object may not be suitable for the actual situation of the logistics object. For example, the packaging materials selected for packaging the logistics object may not be suitable for the logistics object, or the packaging method may not be suitable for the logistics object. This may result in the logistics object being easily damaged, which may prevent the logistics object from reaching the user safely and quickly.
[0039] Therefore, there is a need to improve the accuracy of identifying the logistics attributes of logistics objects.
[0040] In order to improve the accuracy of identifying the logistics attributes of logistics objects, the inventors analyzed the objectively existing phenomena of identifying the logistics attributes of logistics objects and the methods of using models to identify the logistics attributes of logistics objects, and reached the following conclusions:
[0041] On the one hand, objectively speaking, there are many types of logistics attributes of logistics objects. Given the variety of logistics attributes, it is often difficult to balance the number of sample logistics objects with different labeled logistics attributes in the multiple sample data used for model training. In addition, the number of sample logistics objects with some labeled logistics attributes is very small or non-existent, which leads to model bias during the training process. Consequently, the generalization ability of the trained model is low, resulting in low accuracy of the model in identifying the logistics attributes of logistics objects.
[0042] On the other hand, the name of a logistics object contains limited information about it. Identifying the logistics attributes of a logistics object solely based on its name results in a lack of information and thus low accuracy in identifying its logistics attributes.
[0043] In view of this, in order to improve the accuracy of identifying the logistics attributes of logistics objects, the inventors conceived of enriching the information of logistics objects so that when it is necessary to identify the logistics attributes of logistics objects, more relevant information about the logistics objects can be combined to identify the logistics attributes, thereby improving the accuracy of identifying the logistics attributes of logistics objects.
[0044] Specifically, refer to Figure 1 The diagram illustrates a flowchart of a method for training a logistics attribute recognition model according to this application. This method is applied to electronic devices and includes:
[0045] In step S101, at least one sample dataset is obtained, which includes at least: sample object description information of the sample logistics object and labeled logistics attributes of the sample logistics object.
[0046] In this application, for any given sample dataset, the sample dataset includes sample object description information of a sample logistics object and the labeled logistics attributes of that sample logistics object. The same applies to every other sample dataset.
[0047] Sample logistics objects can include logistics objects that have been actually handled in the actual logistics operations in the historical process. By using logistics objects that have been actually handled in the actual logistics operations in the historical process as sample logistics objects, it is not necessary to manually collect sample logistics objects again, thereby improving efficiency and reducing labor costs.
[0048] The labeled logistics attributes of sample logistics objects can be manually labeled in real time by logistics-related personnel during actual logistics operations in the historical process.
[0049] The logistics attributes that logistics personnel manually annotate in real time on logistics objects can be already recorded on the server. In this way, the labeled logistics attributes of sample logistics objects can be obtained directly from the server, avoiding the need for manual annotation of logistics attributes on sample logistics objects again. This can improve the efficiency of obtaining labeled logistics attributes of sample logistics objects and reduce labor costs.
[0050] In the actual logistics operations of historical processes, the number of logistics objects handled is often massive. When selecting sample logistics objects from this massive number of objects, we can select those with a large number of labeled logistics attributes. This achieves the goal of "covering as many types of labeled logistics attributes as possible in the selected sample logistics objects, given a certain number of sample logistics objects." Furthermore, the frequency of each labeled logistics attribute in the selected sample logistics objects can be balanced to improve the generalization ability of the trained logistics attribute recognition model, that is, to improve the accuracy of the trained logistics attribute recognition model in recognizing the logistics attributes of logistics objects.
[0051] For example, in one instance, staff can manually input multiple labeled logistics attributes related to the required scenario into an electronic device. In this way, when the electronic device filters sample logistics objects from a massive number of logistics objects, it can select logistics objects that simultaneously possess these multiple labeled logistics attributes and use them as sample logistics objects.
[0052] The sample logistics object description information may include: the name of the sample logistics object, the review information of the sample logistics object (such as the review information of the sample logistics object by the majority of users), and the introduction information of the sample logistics object (such as the explanation information of the sample logistics object by the merchant).
[0053] The sample object description information of the sample logistics object can be stored in the server in advance, so that electronic devices can obtain the object description information of the sample logistics object from the server.
[0054] However, sometimes the sample object description information of sample logistics objects often includes a lot of text, and the text may not be standardized, for example, it may contain special characters, inconsistent number formats, or inconsistent letter case.
[0055] Thus, in this application, the sample object description information of the sample logistics object can also be standardized. For example, the letters in the sample object description information of the sample logistics object can be unified into uppercase or lowercase letters, the numbers in the sample object description information of the sample logistics object can be unified into Arabic numerals, and special characters in the sample object description information of the sample logistics object can be deleted.
[0056] For example, logistics attributes include: restrictions on the transport of the logistics object, tariffs on the logistics object, whether the logistics object is fragile or easily leaked, whether the logistics object is electrically charged, whether the logistics object is magnetic, whether the logistics object is flammable, and whether the logistics object is explosive.
[0057] Specifically, it can include embargoed or not embargoed, which tariff applies, fragile or not fragile, leaky or not leaky, electrically charged or not electrically charged, flammable or not flammable, explosive or not explosive, etc. Of course, it can also include other logistics attributes, which can be determined according to the actual situation, and will not be detailed here.
[0058] The objects of logistics can include goods, etc.
[0059] In step S102, the network structure of the logistics attribute recognition model is created.
[0060] In one embodiment of this application, see [link to embodiment]. Figure 2 The network structure of the logistics attribute recognition model includes at least an attribute feature extraction network, a relevance feature extraction network, an attention feature extraction network, and a logistics attribute determination network.
[0061] In one embodiment, the input of the logistics attribute recognition model includes the input of an attribute feature extraction network.
[0062] The output of the attribute feature extraction network is connected to the input of the relevance feature extraction network, and the output of the attribute feature extraction network is also connected to the input of the attention feature extraction network.
[0063] The outputs of the relevance feature extraction network and the attention feature extraction network are connected to the input of the logistics attribute determination network, respectively.
[0064] The output of the logistics attribute recognition model includes the output of the logistics attribute determination network.
[0065] Among them, the attribute feature extraction network is used to obtain the sample attribute features of multiple basic sample attributes related to logistics attributes of the sample logistics object based on the sample object description information of the sample logistics object.
[0066] The correlation feature extraction network is used to obtain the sample correlation features, which represent the basic attributes of each sample, and the correlation between the sample attribute features and each candidate logistics attribute among multiple candidate logistics attributes.
[0067] Candidate logistics attributes can be multiple pre-set logistics attributes. The logistics attribute recognition model needs to identify the logistics attributes of the sample logistics object from multiple candidate logistics attributes.
[0068] The attention feature extraction network is used to extract the attention features of the associated basic attributes of a sample basic attribute from at least the sample attribute features of the multiple sample basic attributes. This results in the corresponding attention feature for that sample basic attribute. The same process is repeated for each of the other sample basic attributes, thus obtaining the attention features for each individual sample basic attribute.
[0069] The logistics attribute determination network is used to determine the logistics attribute of a sample logistics object from multiple candidate logistics attributes based on the sample relevance features and the sample attention features corresponding to each of the multiple sample basic attributes.
[0070] Furthermore, in another embodiment, see Figure 3 The attribute feature extraction network includes an attribute description information acquisition layer and an attribute feature extraction layer.
[0071] In one embodiment, the input of the attribute feature extraction network includes the input of the attribute description information acquisition layer.
[0072] The output of the attribute description information acquisition layer is connected to the input of the attribute feature extraction layer.
[0073] The output of the attribute feature extraction network includes the output of the attribute feature extraction layer.
[0074] The attribute description information acquisition layer is used to obtain the sample attribute description information of each sample basic attribute of the sample logistics object based on the sample object description information of the sample logistics object.
[0075] The attribute feature extraction layer is used to obtain the sample attribute features of each sample basic attribute of the sample logistics object based on the sample attribute description information of each sample basic attribute of the sample logistics object.
[0076] The basic attributes of logistics objects include their material, category, composition, weight calculation method, quality, and status, etc.
[0077] Materials include glass, metal, plastic, and wood, among others.
[0078] Categories include types, such as beverages, milk, vegetables, meat, and alcoholic beverages.
[0079] States include liquids, solids, and gases.
[0080] The attribute characteristics of the basic attributes of a logistics object can reflect the basic attributes of the logistics object.
[0081] For example, if the logistics object is pure milk in glass bottles, then the "material" of the logistics object is "glass" and the "category" is "milk", etc.
[0082] The attribute description information of a basic attribute of a logistics object can be represented by a triple. The triple can include: the object identifier of the logistics object, the basic attribute of the logistics object, and the attribute description information of the basic attribute of the logistics object.
[0083] Different logistics objects have different object identifiers.
[0084] The attribute description information of the basic attributes of a logistics object is used to represent the basic attributes of the logistics object. For example, the attribute description information "milk" is used to represent the basic attribute "category" of the logistics object, and the attribute description information "glass" is used to identify the basic attribute "material" of the logistics object.
[0085] In the example above, the triplet of the attribute description information of the basic attributes of the logistics object can include {object identifier of the logistics object, category, milk} and {object identifier of the logistics object, material, glass}.
[0086] Correspondingly, the attribute characteristics of a basic attribute of a logistics object can be represented by a triple. The triple can include: the encoding of the object identifier of the logistics object, the encoding of the basic attribute of the logistics object, and the encoding of the attribute description information of the basic attribute of the logistics object.
[0087] The attribute feature extraction layer is used to obtain the encoding of the object identifier, the encoding of the basic attributes, and the encoding of the attribute description information of the basic attributes of the logistics object, based at least on the object identifier, the basic attributes, and the attribute description information of the basic attributes of the logistics object.
[0088] In one embodiment of this application, see [reference needed]. Figure 4 The attribute description information acquisition layer can include NER (Named Entity Recognition) models, etc.
[0089] The attribute feature extraction layer can include models such as BERT (Bidirectional Enoceder Representations from Transformers, a pre-trained model proposed by Google).
[0090] Relevance feature extraction networks can include models such as transE (Translating Embedding), for example, XtransE.
[0091] Attention feature extraction networks can include GAT (Graph Attention Networks), etc.
[0092] The logistics attribute determination network can include Softmax, etc.
[0093] In step S103, the network parameters in the logistics attribute recognition model are trained using the sample dataset until the network parameters converge, thus obtaining the logistics attribute recognition model.
[0094] After creating the network structure of the logistics attribute recognition model, the network parameters in the logistics attribute recognition model can be trained based on at least one sample dataset.
[0095] During the training process, the sample object description information of the sample logistics object can be input into the logistics attribute recognition model.
[0096] First, the attribute feature extraction network in the logistics attribute recognition model obtains the sample object description information of the sample logistics object. Based on the sample object description information of the sample logistics object, the attribute feature extraction network can obtain the sample attribute features of multiple basic sample attributes of the sample logistics object related to the logistics attribute, and input the sample attribute features of multiple basic sample attributes of the sample logistics object into the relevance feature extraction network and the attention feature extraction network respectively.
[0097] Among them, after obtaining the sample attribute features of multiple sample basic attributes of the sample logistics object, the correlation feature extraction network can obtain the sample correlation features used to characterize the correlation between the sample attribute features of each sample basic attribute and each candidate logistics attribute among multiple candidate logistics attributes; and input the sample correlation features into the logistics attribute determination network.
[0098] Furthermore, after obtaining the sample attribute features of multiple basic attributes of the sample logistics object, the attention feature extraction network, for any one of the multiple basic attributes, at least based on that basic attribute, obtains the sample attention features of the sample-related basic attributes of that basic attribute, thus obtaining the sample attention features corresponding to that basic attribute. The same process is repeated for each of the other basic attributes, thereby obtaining the sample attention features corresponding to each of the multiple basic attributes. These sample attention features are then input into the logistics attribute determination network.
[0099] Secondly, after obtaining the sample relevance features and the sample attention features corresponding to each of the multiple sample basic attributes, the logistics attribute determination network can determine the logistics attribute of the sample logistics object from multiple candidate logistics attributes based on the sample relevance features and the sample attention features corresponding to each of the multiple sample basic attributes, and output the logistics attribute of the sample logistics object.
[0100] Then, the network parameters in the logistics attribute recognition model can be adjusted using a loss function and based on the logistics attributes of the identified sample logistics objects and the labeled logistics attributes of the sample logistics objects, until the network parameters in the logistics attribute recognition model converge, thus completing the training and the resulting logistics attribute recognition model can be put online for use.
[0101] For example, a trained logistics attribute recognition model can be used to obtain the logistics attributes of a logistics object based on its object description information. For instance, when the logistics attributes of a logistics object are needed, the object description information of the logistics object can be input into the trained logistics attribute recognition model so that the model can process the object description information to obtain the logistics attributes of the logistics object and output them for application in subsequent logistics operations. For example, the logistics attributes of the logistics object can be used to determine the logistics solution (e.g., packaging method and delivery method) for the logistics object.
[0102] The process of "the logistics attribute identification model processing the object description information of logistics objects to obtain the logistics attributes of logistics objects" can be found in [reference needed]. Figure 5 The example shown.
[0103] See Figure 5 The diagram illustrates a data processing method applied in an electronic device, which includes:
[0104] In step S201, the attribute characteristics of multiple basic attributes related to logistics attributes of the logistics object are obtained based on the object description information of the logistics object.
[0105] In one embodiment of this application, this step can be implemented through the following process, including:
[0106] 2021. Obtain the attribute description information of multiple basic attributes of the logistics object based on the object description information of the logistics object.
[0107] In this application, when it is necessary to obtain the logistics attributes of a logistics object, the electronic device can first obtain the object identifier of the logistics object. The object identifier of the logistics object may include the logistics object's ID (Identity Document) or number, etc. The electronic device can obtain the object identifier of the logistics object by scanning a code.
[0108] For example, a logistics label (including express delivery label) is affixed to the surface of the logistics object. The logistics label includes a barcode or QR code, which contains the object identifier of the logistics object. Thus, by scanning the barcode or QR code on the logistics label affixed to the surface of the logistics object and parsing the scanned data, the object identifier of the logistics object can be obtained.
[0109] Then, based on the object identifier of the logistics object, the object description information of the logistics object can be obtained. The object description information of the logistics object may include: the name of the logistics object, the comments information of the logistics object (such as comments from users on the logistics object), and the introduction information of the logistics object (such as explanations from the logistics object's merchants).
[0110] The object description information of the logistics object can be stored in the server in advance. In this way, electronic devices can obtain the object description information of the logistics object from the server based on the object identifier of the logistics object.
[0111] However, sometimes, the object description information obtained from logistics objects often includes a lot of text, which may not be standardized. For example, it may contain special characters, inconsistent number formats, or inconsistent letter case.
[0112] Thus, in this application, the object description information of the logistics object can also be standardized, for example, by unifying the letters in the object description information of the logistics object to uppercase or lowercase letters, unifying the numbers in the object description information of the logistics object to Arabic numerals, and deleting special characters in the object description information of the logistics object.
[0113] In this application, the attribute description information of multiple basic attributes of a logistics object can be obtained by using the attribute description information acquisition layer in the attribute feature extraction network of the logistics attribute recognition model, based on the object description information of the logistics object.
[0114] For example, the attribute description information acquisition layer includes a NER model, so that the object description information of the logistics object can be input into the NER model included in the attribute description information acquisition layer, so that the NER model can process the object description information of the logistics object, obtain the attribute description information of multiple basic attributes of the logistics object, and output the attribute description information of multiple basic attributes of the logistics object.
[0115] Alternatively, in another embodiment, the attribute description information acquisition layer in the attribute feature extraction network of the logistics attribute recognition model may also include a KNN (K-Nearest Neighbor) model, etc.
[0116] In this way, the object description information of the logistics object can be input into the KNN model included in the attribute description information acquisition layer, so that the KNN model can process the object description information of the logistics object, obtain the attribute description information of multiple basic attributes of the logistics object, and output the attribute description information of multiple basic attributes of the logistics object.
[0117] Among them, the KNN model can take into account both the character and semantic aspects of the object description information of logistics objects, thereby improving the accuracy of the attribute description information of multiple basic attributes of logistics objects.
[0118] Furthermore, in this application, the loss function used in the KNN model can be Triplet, etc., which can take into account the slight differences between different categories and can at least improve the accuracy of obtaining the attribute description information of the basic attribute "category" of the logistics object.
[0119] Secondly, the KNN model can further refine the basic attribute "category" of logistics objects, such as mining "synonyms" and "hyper- ...
[0120] However, the attribute description information of multiple basic attributes of logistics objects obtained based on the attribute description information acquisition layer may be standard attribute description information or non-standard attribute description information. If it is non-standard attribute description information, it may affect the accuracy of identifying the logistics attributes of logistics objects in the future.
[0121] Therefore, when developers set the basic attributes (such as material and category) that logistics objects may have, they can also set the possible attribute description information for each basic attribute separately, and use it as the standard attribute description information for each basic attribute. In the scenario of training the logistics attribute recognition model and in the scenario of using the trained logistics attribute recognition model to identify the logistics attributes of logistics objects, the standard attribute description information of the basic attributes of logistics objects can be used as much as possible to avoid the impact of non-standard attribute description information on the accuracy of identifying the logistics attributes of logistics objects.
[0122] For example, for the basic attribute "category", one of the attribute descriptions could be "children's milk". Developers can use "children's milk" as the standard attribute description for the basic attribute "category".
[0123] Thus, if the attribute description information of the basic attribute "category" of the logistics object is identified as "children's milk" or "children's milk products", the identified attribute description information "children's milk" or "children's milk products" can be adjusted to the standard attribute description information "children's milk" or "children's milk", and then the standard attribute description information "children's milk" can be used to determine the subsequent logistics attributes.
[0124] Specifically, when obtaining the attribute description information of multiple basic attributes of a logistics object based on the object description information of the logistics object, the candidate attribute description information of multiple basic attributes of the logistics object can be obtained separately based on the object description information of the logistics object. For example, the aforementioned NER model can be used to obtain the candidate attribute description information of multiple basic attributes of the logistics object separately based on the object description information of the logistics object.
[0125] Then, for any candidate attribute description information of a basic attribute, search in the attribute description information database, which includes multiple reference attribute description information, to see if there is any reference attribute description information of the basic attribute that is the same as the candidate attribute description information of the basic attribute.
[0126] The attribute description information library, which includes multiple reference attribute description information, can be set up in advance by the developers. The reference attribute description information can be standard attribute description information, etc. The attribute description information library includes at least the attribute description information of each standard of the basic attribute, such as the standard attribute description information "children's milk" mentioned above.
[0127] If there is a reference attribute description information for the basic attribute that is identical to the candidate attribute description information of the basic attribute, the attribute description information of the basic attribute of the logistics object is obtained based on the candidate attribute description information of the basic attribute. For example, the candidate attribute description information of the basic attribute is directly used to obtain the attribute description information of the basic attribute of the logistics object.
[0128] If there is no reference attribute description information for the basic attribute that is identical to the candidate attribute description information of the basic attribute, reference attribute description information with the same meaning as the candidate attribute description information of the basic attribute can be determined in the attribute description information database, and the attribute description information of the basic attribute of the logistics object can be obtained based on the determined reference attribute description information.
[0129] Specifically, when determining reference attribute description information with the same meaning as candidate attribute description information of a basic attribute in the attribute description information database, the text similarity between the candidate attribute description information of the basic attribute and each reference attribute description information of the basic attribute in the attribute description information database can be calculated (e.g., character similarity, which can be calculated using edit distance or the Jaccard algorithm). Then, reference attribute description information of the basic attribute with a text similarity greater than a preset text similarity threshold is selected. Next, the semantic similarity between the candidate attribute description information of the basic attribute and each selected reference attribute description information of the basic attribute can be calculated (semantic similarity can be calculated using methods such as word to vector (a related model used to generate word vectors) or Chinese-Bert-Wwm (a language model based on full-word masking pre-training). Then, reference attribute description information of the basic attribute with a semantic similarity greater than a preset semantic similarity threshold is selected and used as reference attribute description information with the same meaning as the candidate attribute description information of the basic attribute.
[0130] In one embodiment, when at least two reference attribute descriptions are determined (at least two reference attribute descriptions of the basic attribute with a semantic similarity greater than a preset semantic similarity threshold and the same semantic similarity with the candidate attribute descriptions of the basic attribute), the reference attribute description information that has been used most frequently in the historical process can be selected from the at least two determined reference attribute descriptions; the attribute description information of the basic attribute of the logistics object is obtained based on the reference attribute description information that has been used most frequently, for example, the reference attribute description information that has been used most frequently is used as the attribute description information of the basic attribute of the logistics object, etc.
[0131] The preset text similarity threshold and preset semantic similarity threshold can be determined according to the actual situation, and will not be described in detail here.
[0132] 2022. Obtain the attribute features of multiple basic attributes based on the attribute description information of multiple basic attributes.
[0133] In this application, the attribute features of each basic attribute of the logistics object can be dense features, or they can be deep semantic features, etc.
[0134] In this application, the attribute feature extraction layer in the attribute feature extraction network of the logistics attribute recognition model can be used to obtain the attribute features of multiple basic attributes of the logistics object based on the attribute description information of each basic attribute of the logistics object.
[0135] For example, the attribute feature extraction layer may include a BERT model, so that the attribute description information of each basic attribute of the logistics object can be input into the BERT model included in the attribute feature extraction layer, so that the BERT model can process the attribute description information of each basic attribute of the logistics object, obtain the attribute features of multiple basic attributes of the logistics object, and output the attribute features of multiple basic attributes of the logistics object.
[0136] Attributes and features can be represented by vectors or matrices, etc.
[0137] The BERT model makes the basic attributes of logistics objects denser and has deeper semantic information, thus enriching the information contained in the basic attributes of logistics objects. This can improve the accuracy of identifying the logistics attributes of logistics objects.
[0138] In step S202, the correlation features used to characterize the attribute features of each basic attribute are obtained and the correlation features between each candidate logistics attribute among the multiple candidate logistics attributes.
[0139] Candidate logistics attributes can be multiple pre-set logistics attributes. This application aims to identify the logistics attributes of the logistics object from among multiple candidate logistics attributes.
[0140] For example, logistics attributes include: restrictions on the transport of the logistics object, tariffs on the logistics object, whether the logistics object is fragile or easily leaked, whether the logistics object is electrically charged, whether the logistics object is magnetic, whether the logistics object is flammable, and whether the logistics object is explosive.
[0141] Specifically, it can include embargoed or not embargoed, which tariff applies, fragile or not fragile, leaky or not leaky, electrically charged or not electrically charged, flammable or not flammable, explosive or not explosive, etc. Of course, it can also include other logistics attributes, which can be determined according to the actual situation, and will not be detailed here.
[0142] In this application, the correlation feature extraction network in the logistics attribute identification model can be used to obtain the correlation features between the attribute features representing each basic attribute of the logistics object and each candidate logistics attribute among multiple candidate logistics attributes.
[0143] For example, the relevance feature extraction network may include a transE model. In this way, the attribute features of each basic attribute of the logistics object can be input into the transE model in the relevance feature extraction network. The transE model in the relevance feature extraction network processes the attribute features of each basic attribute and the candidate attribute features of the logistics object to obtain the relevance features that characterize the relevance between each attribute feature of the logistics object and each candidate logistics attribute among multiple candidate logistics attributes. The model then outputs the relevance features that characterize the relevance between each attribute feature of the logistics object and each candidate logistics attribute among multiple candidate logistics attributes.
[0144] By obtaining the correlation characteristics between the attribute features of each basic attribute of a logistics object and each candidate logistics attribute, we can determine the contribution of each basic attribute to each candidate logistics attribute. For example, the attribute feature "milk" of the basic attribute "category" contributes more to the candidate logistics attribute "leaky," and the attribute feature "battery" of the basic attribute "category" contributes more to the candidate logistics attributes "flammable" and "explosive." Therefore, understanding the contribution of each basic attribute to each candidate logistics attribute can improve the accuracy of identifying the logistics attributes of a logistics object and also enhance the interpretability of the identified logistics attributes.
[0145] In addition, the transE model itself has the advantage of interpretability. Thus, the interpretability of the transE model can be improved by using it to identify the logistics attributes of logistics objects.
[0146] In step S203, for any one of the multiple basic attributes, the attention features of the associated basic attributes of the basic attribute are obtained based on the attribute features of the multiple basic attributes, so as to obtain the attention features corresponding to the basic attribute.
[0147] The same applies to each of the other basic attributes, thus obtaining the attention features corresponding to each basic attribute.
[0148] In this application, this step can be implemented through the following process, including:
[0149] 2031. Based on the object identifier of the logistics object, multiple basic attributes of the logistics object, and the attribute features of the multiple basic attributes of the logistics object, construct a knowledge graph of the logistics object. The knowledge graph of the logistics object includes node information and edge information. The node information includes the object identifier of the logistics object and the attribute features of each basic attribute of the logistics object. The edge information includes multiple basic attributes.
[0150] In other words, in a knowledge graph, the information of each node is connected through edge information. Thus, in a knowledge graph, the information of each node often has direct or indirect relationships. For example, if two pieces of information are connected by an edge, they have a direct relationship. As another example, if two pieces of information are linked by two or more edges, they have an indirect relationship.
[0151] 2032. For any one of the multiple basic attributes, based on the edge information and node information in the knowledge graph, determine the associated attribute features of the associated basic attributes that are associated with the attribute features of the basic attribute in the knowledge graph.
[0152] 2033. Based on the attribute characteristics of the basic attribute and the related attribute characteristics, obtain the attention characteristics of the related basic attributes to the basic attribute.
[0153] In this application, the attention feature extraction network in the logistics attribute recognition model can be used to obtain the attention feature of the related basic attribute on the basic attribute based on the attribute features of the basic attribute and the related attribute features.
[0154] For example, the attention feature extraction network may include a GAT model, in which the attribute features of the basic attribute and the associated attribute features can be input into the GAT model in the attention feature extraction network, so that the GAT model in the attention feature extraction network processes the attribute features of the basic attribute and the associated attribute features to obtain the attention features of the associated basic attribute to the basic attribute, and outputs the attention features of the associated basic attribute to the basic attribute.
[0155] GAT is a node classification network based on an attention mechanism. It can automatically select related attribute features that are useful to the attribute features of the basic attribute, and optimize the attribute features of the basic attribute by combining the attention coefficients of the related attribute features with the attribute features of the basic attribute.
[0156] The core of GAT includes GAL (Graph Attention Layer). The input of GAL includes the attribute features of the base attribute, the associated attribute features of the associated base attribute, and the edge information between the associated attribute features of the associated base attribute and the attribute features of the base attribute (the attention weight of the associated attribute features of the associated base attribute to the attribute features of the base attribute can be determined by the content and number of the edge information). The output of GAL is the generated attention feature corresponding to the base attribute.
[0157] Attention mechanisms can be used to obtain topological information about the attributes of multiple basic attributes of a logistics object. This topological information can be used to capture the relationship between the attributes of related basic attributes, thus enriching the features used to identify the logistics attributes of a logistics object and improving the accuracy of identifying the logistics attributes of a logistics object.
[0158] Secondly, the attention mechanism can also determine the importance of the relationship features between different basic attributes. By determining the importance, we can distinguish between important and unimportant relationships between the basic attributes. For example, we can focus more on important relationships and suppress unimportant relationships to highlight more critical features. In turn, we can improve the accuracy of identifying the logistics attributes of logistics objects by focusing on more critical features.
[0159] In step S204, the logistics attributes of the logistics object are determined from multiple candidate logistics attributes based on the relevance features and the attention features corresponding to each of the multiple basic attributes.
[0160] In one embodiment of this application, the logistics attribute determination network in the logistics attribute recognition model can be used to aggregate the attention features corresponding to each of the multiple basic attributes to obtain aggregated features. For example, when the attention features are vectors, the attention features corresponding to each basic attribute can be weighted and summed into a vector and used as the aggregated feature. Then, the relevance features and aggregated features can be concatenated to obtain concatenated features. For example, when both the relevance features and aggregated features are vectors, the relevance features and aggregated features can be concatenated end-to-end to form a vector and used as the concatenated feature. The logistics attribute of the logistics object can then be determined from multiple candidate logistics attributes based on the concatenated features.
[0161] The logistics attribute determination network may include a Softmax layer. The spliced features can be input into the Softmax layer of the logistics attribute determination network so that the Softmax layer of the logistics attribute determination network processes the spliced features to obtain the logistics attributes of the logistics object and outputs the logistics attributes of the logistics object.
[0162] In this application, attribute features of multiple basic attributes related to logistics attributes of the logistics object are obtained based on the object description information of the logistics object. Relevance features, representing the correlation between each attribute feature and each candidate logistics attribute among multiple candidate logistics attributes, are obtained. For any one of the multiple basic attributes, at least based on the attribute features of the multiple basic attributes, the attention features of the associated basic attributes on that basic attribute are obtained, thus obtaining the attention features corresponding to that basic attribute. Based on the correlation features and the attention features corresponding to each of the multiple basic attributes, the logistics attribute of the logistics object is determined from the multiple candidate logistics attributes.
[0163] In this application, by obtaining the correlation characteristics between the attribute features of each basic attribute of the logistics object and each candidate logistics attribute among multiple candidate logistics attributes, the contribution degree of each attribute feature of the logistics object to each candidate logistics attribute can be obtained. For example, the attribute feature "milk" of the basic attribute "category" contributes more to the candidate logistics attribute "leaky", and the attribute feature "battery" of the basic attribute "category" contributes more to the candidate logistics attributes "flammable" and "explosive", etc. In this way, by knowing the contribution degree of each attribute feature of the logistics object to each candidate logistics attribute, the accuracy of identifying the logistics attributes of the logistics object can be improved, and the interpretability of the identified logistics attributes can also be improved.
[0164] Secondly, the attention mechanism can acquire topological information about the relationships between the attribute features of multiple basic attributes of a logistics object. This topological information can capture the relational features between related basic attribute features, thus enriching the features used to identify the logistics attributes of the object and improving the accuracy of attribute identification. Furthermore, the attention mechanism can determine the importance of the relational features between different basic attribute features. This importance can distinguish between important and unimportant relationships; for example, it can focus more on important relationships and suppress unimportant ones to highlight more critical features, thereby improving the accuracy of logistics attribute identification.
[0165] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by this application.
[0166] Reference Figure 6 The diagram shows a structural block diagram of a device for identifying logistics attributes according to this application, the device comprising:
[0167] The first acquisition module 11 is used to acquire attribute features of multiple basic attributes related to logistics attributes of the logistics object based on the object description information of the logistics object; the second acquisition module 12 is used to acquire correlation features that characterize the correlation between the attribute features of each basic attribute and each candidate logistics attribute among multiple candidate logistics attributes; the third acquisition module 13 is used to, for any one of the multiple basic attributes, at least based on the attribute features of the multiple basic attributes, acquire the attention features of the associated basic attributes of the basic attribute on the basic attribute, and obtain the attention features corresponding to the basic attribute; the determination module 14 is used to determine the logistics attribute of the logistics object among the multiple candidate logistics attributes based on the correlation features and the attention features corresponding to each basic attribute.
[0168] In an optional implementation, the determining module includes: an aggregation unit, used to aggregate the attention features corresponding to each of the basic attributes to obtain aggregated features; a splicing unit, used to splice the relevance features and the aggregated features to obtain spliced features; and a first determining unit, used to determine the logistics attribute of the logistics object from the plurality of candidate logistics attributes based on the spliced features.
[0169] In an optional implementation, the first acquisition module includes: a first acquisition unit, configured to acquire attribute description information of the plurality of basic attributes of the logistics object based on the object description information; and a second acquisition unit, configured to acquire attribute features of the plurality of basic attributes based on the attribute description information of the plurality of basic attributes.
[0170] In an optional implementation, the first acquisition unit includes: a first acquisition subunit, configured to acquire candidate attribute description information of the plurality of basic attributes according to the object description information; a search subunit, configured to, for any candidate attribute description information of a basic attribute, search in an attribute description information database including a plurality of reference attribute description information whether there is reference attribute description information of the basic attribute that is the same as the candidate attribute description information of the basic attribute; a second acquisition subunit, configured to, if there is reference attribute description information of the basic attribute that is the same as the candidate attribute description information of the basic attribute, acquire the attribute description information of the basic attribute of the logistics object according to the candidate attribute description information of the basic attribute; a first determination subunit, configured to, if there is no reference attribute description information of the basic attribute that is the same as the candidate attribute description information of the basic attribute, determine in the attribute description information database a reference attribute description information that has the same meaning as the candidate attribute description information of the basic attribute; and a second determination subunit, configured to acquire the attribute description information of the basic attribute of the logistics object according to the determined reference attribute description information.
[0171] In one optional implementation, the second determining subunit is specifically used to: when there are at least two determined reference attribute descriptions, select the reference attribute description information that has been used the most times in the historical process from the at least two determined reference attribute descriptions; and obtain the attribute description information of the basic attribute of the logistics object based on the reference attribute description information that has been used the most times.
[0172] In an optional implementation, the third acquisition module includes: a construction unit, configured to construct a knowledge graph of the logistics object based on the object identifier of the logistics object, the plurality of basic attributes of the logistics object, and the attribute features of the plurality of basic attributes of the logistics object, wherein the knowledge graph includes node information and edge information, the node information including the object identifier of the logistics object and the attribute features of each basic attribute of the logistics object, and the edge information including the plurality of basic attributes; a second determination unit, configured to, for any one of the plurality of basic attributes, determine, in the knowledge graph, the associated attribute features of the associated basic attributes related to the attribute features of the basic attributes; and a third acquisition unit, configured to acquire the attention features of the associated basic attributes on the basic attributes based on the attribute features of the basic attributes and the associated attribute features.
[0173] In this application, attribute features of multiple basic attributes related to logistics attributes of the logistics object are obtained based on the object description information of the logistics object. Relevance features, representing the correlation between each attribute feature and each candidate logistics attribute among multiple candidate logistics attributes, are obtained. For any one of the multiple basic attributes, at least based on the attribute features of the multiple basic attributes, the attention features of the associated basic attributes on that basic attribute are obtained, thus obtaining the attention features corresponding to that basic attribute. Based on the correlation features and the attention features corresponding to each of the multiple basic attributes, the logistics attribute of the logistics object is determined from the multiple candidate logistics attributes.
[0174] In this application, by obtaining the correlation characteristics between the attribute features of each basic attribute of the logistics object and each candidate logistics attribute among multiple candidate logistics attributes, the contribution degree of each attribute feature of the logistics object to each candidate logistics attribute can be obtained. For example, the attribute feature "milk" of the basic attribute "category" contributes more to the candidate logistics attribute "leaky", and the attribute feature "battery" of the basic attribute "category" contributes more to the candidate logistics attributes "flammable" and "explosive", etc. In this way, by knowing the contribution degree of each attribute feature of the logistics object to each candidate logistics attribute, the accuracy of identifying the logistics attributes of the logistics object can be improved, and the interpretability of the identified logistics attributes can also be improved.
[0175] Secondly, the attention mechanism can acquire topological information about the relationships between the attribute features of multiple basic attributes of a logistics object. This topological information can capture the relational features between related basic attribute features, thus enriching the features used to identify the logistics attributes of the object and improving the accuracy of attribute identification. Furthermore, the attention mechanism can determine the importance of the relational features between different basic attribute features. This importance can distinguish between important and unimportant relationships; for example, it can focus more on important relationships and suppress unimportant ones to highlight more critical features, thereby improving the accuracy of logistics attribute identification.
[0176] Reference Figure 7 The diagram shows a structural block diagram of an apparatus for training a logistics attribute recognition model according to this application. The apparatus includes:
[0177] The fourth acquisition module 21 is used to acquire at least one sample dataset, which includes: sample object description information of sample logistics objects and labeled logistics attributes of the sample logistics objects; the creation module 22 is used to create the network structure of a logistics attribute recognition model; the training module 23 is used to train the network parameters in the logistics attribute recognition model using the sample dataset until the network parameters converge, thereby obtaining the logistics attribute recognition model; wherein, the network structure includes at least an attribute feature extraction network, a relevance feature extraction network, an attention feature extraction network, and a logistics attribute determination network; the attribute feature extraction network is used to acquire sample attribute features of multiple basic sample attributes related to logistics attributes of the sample logistics objects based on the sample object description information of the sample logistics objects; The relevance feature extraction network is used to obtain sample relevance features, which characterize the relevance between sample attribute features representing the basic attributes of each sample and each candidate logistics attribute among multiple candidate logistics attributes; the attention feature extraction network is used, for any sample basic attribute among the multiple sample basic attributes, to obtain the sample attention feature of the sample association basic attribute on the sample basic attribute, based at least on the sample attribute features of the multiple sample basic attributes, to obtain the sample attention feature corresponding to the sample basic attribute; the logistics attribute determination network is used to determine the logistics attribute of the sample logistics object among the multiple candidate logistics attributes based on the sample relevance feature and the sample attention feature corresponding to each sample basic attribute among the multiple sample basic attributes.
[0178] In one optional implementation, the attribute feature extraction network includes an attribute description information acquisition layer and an attribute feature extraction layer; the attribute description information acquisition layer is used to acquire sample attribute description information of each sample basic attribute of the sample logistics object based on the sample object description information of the sample logistics object; the attribute feature extraction layer is used to acquire sample attribute features of each sample basic attribute of the sample logistics object based on the sample attribute description information of each sample basic attribute of the sample logistics object.
[0179] In this application, when it is necessary to obtain the object description information of a logistics object, a logistics attribute recognition model can be used to obtain the object description information. For example, the logistics attribute recognition model can be used to obtain the attribute features of multiple basic attributes related to the logistics attribute of the logistics object based on the object description information. Relevance features, which characterize the correlation between the attribute features of each basic attribute and each candidate logistics attribute among multiple candidate logistics attributes, are then obtained. For any one of the multiple basic attributes, at least based on the attribute features of the multiple basic attributes, the attention features of the associated basic attributes of that basic attribute are obtained, thus obtaining the attention features corresponding to that basic attribute. Based on the correlation features and the attention features corresponding to each of the multiple basic attributes, the logistics attribute of the logistics object is determined from among the multiple candidate logistics attributes.
[0180] In this application, by obtaining the correlation characteristics between the attribute features of each basic attribute of the logistics object and each candidate logistics attribute among multiple candidate logistics attributes, the contribution degree of each attribute feature of the logistics object to each candidate logistics attribute can be obtained. For example, the attribute feature "milk" of the basic attribute "category" contributes more to the candidate logistics attribute "leaky", and the attribute feature "battery" of the basic attribute "category" contributes more to the candidate logistics attributes "flammable" and "explosive", etc. In this way, by knowing the contribution degree of each attribute feature of the logistics object to each candidate logistics attribute, the accuracy of identifying the logistics attributes of the logistics object can be improved, and the interpretability of the identified logistics attributes can also be improved.
[0181] Secondly, the attention mechanism can acquire topological information about the relationships between the attribute features of multiple basic attributes of a logistics object. This topological information can capture the relational features between related basic attribute features, thus enriching the features used to identify the logistics attributes of the object and improving the accuracy of attribute identification. Furthermore, the attention mechanism can determine the importance of the relational features between different basic attribute features. This importance can distinguish between important and unimportant relationships; for example, it can focus more on important relationships and suppress unimportant ones to highlight more critical features, thereby improving the accuracy of logistics attribute identification.
[0182] This application also provides a non-volatile readable storage medium storing one or more modules (programs). When these modules are applied to a device, they enable the device to execute the instructions for the method steps in this application.
[0183] This application provides one or more machine-readable media storing instructions that, when executed by one or more processors, cause an electronic device to perform one or more of the methods described in the above embodiments. In this application, the electronic device includes servers, gateways, sub-devices, etc., with the sub-devices being devices such as Internet of Things (IoT) devices.
[0184] Embodiments of this disclosure can be implemented as an apparatus with any suitable hardware, firmware, software, or any combination thereof, configured as desired. This apparatus may include electronic devices such as servers (clusters) and terminal devices such as IoT devices.
[0185] Figure 8 An exemplary apparatus 1300 is schematically shown that can be used to implement the various embodiments described in this application.
[0186] In one embodiment, Figure 8 An exemplary device 1300 is shown, which includes one or more processors 1302, a control module (chipset) 1304 coupled to at least one of the processors 1302, a memory 1306 coupled to the control module 1304, a non-volatile memory (NVM) / storage device 1308 coupled to the control module 1304, one or more input / output devices 1310 coupled to the control module 1304, and a network interface 1312 coupled to the control module 1304.
[0187] Processor 1302 may include one or more single-core or multi-core processors, and processor 1302 may include any combination of general-purpose processors or special-purpose processors (e.g., graphics processors, application processors, baseband processors, etc.). In some embodiments, device 1300 can serve as a server device such as a gateway as described in the embodiments of this application.
[0188] In some embodiments, apparatus 1300 may include one or more computer-readable media (e.g., memory 1306 or NVM / storage device 1308) having instructions 1314 and one or more processors 1302 that are combined with the one or more computer-readable media and configured to execute instructions 1314 to implement modules and thus perform the actions described in this disclosure.
[0189] In one embodiment, the control module 1304 may include any suitable interface controller to provide any suitable interface to at least one of the processors 1302 and / or any suitable device or component communicating with the control module 1304.
[0190] The control module 1304 may include a memory controller module to provide an interface to the memory 1306. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0191] Memory 1306 may be used, for example, to load and store data and / or instructions 1314 for device 1300. In one embodiment, memory 1306 may include any suitable volatile memory, such as suitable DRAM. In some embodiments, memory 1306 may include double data rate quad synchronous dynamic random access memory (DDR4 SDRAM).
[0192] In one embodiment, the control module 1304 may include one or more input / output controllers to provide interfaces to the NVM / storage device 1308 and (one or more) input / output devices 1310.
[0193] For example, NVM / storage device 1308 may be used to store data and / or instructions 1314. NVM / storage device 1308 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable (one or more) non-volatile storage devices (e.g., one or more hard disk drives (HDDs), one or more optical disc drives (CDs), and / or one or more digital universal optical disc (DVD) drives).
[0194] NVM / storage device 1308 may include storage resources that are physically part of a device on which device 1300 is mounted, or that can be accessed by the device without needing to be part of the device. For example, NVM / storage device 1308 may be accessed via a network via one or more input / output devices 1310.
[0195] One or more input / output devices 1310 may provide an interface for device 1300 to communicate with any other suitable device. Input / output devices 1310 may include communication components, pinyin components, sensor components, etc. Network interface 1312 may provide an interface for device 1300 to communicate via one or more networks. Device 1300 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, such as accessing wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, 5G, etc., or combinations thereof.
[0196] In one embodiment, at least one of the processors 1302 may be logically packaged with one or more controllers (e.g., memory controller modules) of the control module 1304. In one embodiment, at least one of the processors 1302 may be logically packaged with one or more controllers of the control module 1304 to form a system-in-package (SiP). In one embodiment, at least one of the processors 1302 may be integrated with the logic of one or more controllers of the control module 1304 on the same die. In one embodiment, at least one of the processors 1302 may be integrated with the logic of one or more controllers of the control module 1304 on the same die to form a system-on-a-chip (SoC).
[0197] In various embodiments, device 1300 may be, but is not limited to, a server, desktop computing device, or mobile computing device (e.g., laptop computing device, handheld computing device, tablet computer, netbook, etc.). In various embodiments, device 1300 may have more or fewer components and / or different architectures. For example, in some embodiments, device 1300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touchscreen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0198] This application provides an electronic device, including: one or more processors; and one or more machine-readable media having instructions stored thereon, which, when executed by the one or more processors, cause the electronic device to perform one or more methods as described in this application.
[0199] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0200] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0201] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable information processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable information processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0202] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable information processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0203] These computer program instructions can also be loaded onto a computer or other programmable information processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0204] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present application.
[0205] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0206] The data processing method and apparatus provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for identifying logistics attributes, characterized in that, The method includes: Based on the object description information of the logistics object, obtain the attribute characteristics of multiple basic attributes related to the logistics attributes of the logistics object; Obtain correlation features that characterize the correlation between the attribute features used to represent each basic attribute and each candidate logistics attribute among multiple candidate logistics attributes; Furthermore, for any one of the plurality of basic attributes, at least based on the attribute features of the plurality of basic attributes, the attention features of the associated basic attributes on the basic attribute are obtained to obtain the attention features corresponding to the basic attribute, including: constructing a knowledge graph of the logistics object based on the object identifier of the logistics object, the plurality of basic attributes of the logistics object, and the attribute features of the plurality of basic attributes of the logistics object, the knowledge graph including node information and edge information, the node information including the object identifier of the logistics object and the attribute features of each basic attribute of the logistics object, and the edge information used to characterize the association relationship between the plurality of basic attributes; for any one of the plurality of basic attributes, based on the edge information and node information in the knowledge graph, determining the associated attribute features of the associated basic attributes associated with the attribute features of the basic attribute in the knowledge graph; obtaining the attention features of the associated basic attributes on the basic attribute based on the attribute features of the basic attribute and the associated attribute features; Based on the relevance features and the attention features corresponding to each basic attribute, the logistics attributes of the logistics object are determined from the plurality of candidate logistics attributes.
2. The method according to claim 1, characterized in that, The step of determining the logistics attribute of the logistics object from the plurality of candidate logistics attributes based on the relevance features and the attention features corresponding to each basic attribute includes: The attention features corresponding to each basic attribute are aggregated to obtain the aggregated features; By concatenating the relevance feature and the aggregation feature, a concatenated feature is obtained; The logistics attributes of the logistics object are determined from the plurality of candidate logistics attributes based on the splicing features.
3. The method according to claim 1, characterized in that, The step of obtaining attribute features of multiple basic attributes related to logistics attributes of a logistics object based on its object description information includes: Based on the object description information, obtain the attribute description information of the multiple basic attributes of the logistics object; The attribute features of the multiple basic attributes are obtained based on the attribute description information of the multiple basic attributes.
4. The method according to claim 3, characterized in that, The step of obtaining the attribute description information of the multiple basic attributes of the logistics object based on the object description information includes: Based on the object description information, obtain the candidate attribute description information of the multiple basic attributes respectively; For any candidate attribute description information of a basic attribute, search in the attribute description information database, which includes multiple reference attribute description information, whether there is reference attribute description information of the basic attribute that is the same as the candidate attribute description information of the basic attribute. If there is reference attribute description information for the basic attribute that is identical to the candidate attribute description information of the basic attribute, the attribute description information of the basic attribute of the logistics object is obtained based on the candidate attribute description information of the basic attribute. If there is no reference attribute description information for the basic attribute that is identical to the candidate attribute description information of the basic attribute, a reference attribute description information with the same meaning as the candidate attribute description information of the basic attribute is determined in the attribute description information database, and the attribute description information of the basic attribute of the logistics object is obtained based on the determined reference attribute description information.
5. A method for training a logistics attribute recognition model, characterized in that, The method includes: Obtain at least one sample dataset, the sample dataset including: sample object description information of sample logistics objects and labeled logistics attributes of the sample logistics objects; Create the network structure for the logistics attribute recognition model; The network parameters in the logistics attribute recognition model are trained using the sample dataset until the network parameters converge to obtain the logistics attribute recognition model. The network structure includes at least an attribute feature extraction network, a relevance feature extraction network, an attention feature extraction network, and a logistics attribute determination network; The attribute feature extraction network is used to obtain sample attribute features of multiple basic sample attributes related to logistics attributes of the sample logistics object based on the sample object description information of the sample logistics object; The correlation feature extraction network is used to obtain sample correlation features, which characterize the basic attributes of each sample, and the correlation between the sample attribute features and each candidate logistics attribute among multiple candidate logistics attributes. The attention feature extraction network is used to obtain the sample attention feature of the sample association basic attribute on the sample basic attribute for any one of the plurality of sample basic attributes, based at least on the sample attribute features of the plurality of sample basic attributes, so as to obtain the sample attention feature corresponding to the sample basic attribute. The logistics attribute determination network is used to determine the logistics attribute of the sample logistics object from the multiple candidate logistics attributes based on the sample relevance features and the sample attention features corresponding to each sample basic attribute.
6. A device for identifying logistics attributes, characterized in that, The device includes: The first acquisition module is used to acquire the attribute characteristics of multiple basic attributes related to logistics attributes of the logistics object based on the object description information of the logistics object; The second acquisition module is used to acquire the correlation features of the attribute features used to characterize each basic attribute and the correlation between the attribute features and each candidate logistics attribute in the multiple candidate logistics attributes; The third acquisition module is used to, for any one of the plurality of basic attributes, at least based on the attribute characteristics of the plurality of basic attributes, acquire the attention characteristics of the associated basic attributes of the basic attribute on the basic attribute, and obtain the attention characteristics corresponding to the basic attribute. The determination module is used to determine the logistics attribute of the logistics object from the plurality of candidate logistics attributes based on the relevance feature and the attention feature corresponding to each of the basic attributes; The third acquisition module includes: a construction unit, configured to construct a knowledge graph of the logistics object based on the object identifier of the logistics object, the multiple basic attributes of the logistics object, and the attribute features of the multiple basic attributes of the logistics object, wherein the knowledge graph includes node information and edge information, the node information includes the object identifier of the logistics object and the attribute features of each basic attribute of the logistics object, and the edge information is used to characterize the association relationship between the multiple basic attributes; a second determination unit, configured to, for any one of the multiple basic attributes, determine the associated attribute features of the associated basic attributes in the knowledge graph based on the edge information and node information in the knowledge graph; and a third acquisition unit, configured to acquire the attention features of the associated basic attributes on the basic attributes based on the attribute features of the basic attributes and the associated attribute features.
7. An apparatus for training a logistics attribute recognition model, characterized in that, The device includes: The fourth acquisition module is used to acquire at least one sample dataset, which includes: sample object description information of the sample logistics object and the labeled logistics attributes of the sample logistics object; Create a module to create the network structure for the logistics attribute recognition model; The training module is used to train the network parameters in the logistics attribute recognition model using the sample dataset until the network parameters converge, thereby obtaining the logistics attribute recognition model. The network structure includes at least an attribute feature extraction network, a relevance feature extraction network, an attention feature extraction network, and a logistics attribute determination network; The attribute feature extraction network is used to obtain sample attribute features of multiple basic sample attributes related to logistics attributes of the sample logistics object based on the sample object description information of the sample logistics object; The correlation feature extraction network is used to obtain sample correlation features, which characterize the basic attributes of each sample, and the correlation between the sample attribute features and each candidate logistics attribute among multiple candidate logistics attributes. The attention feature extraction network is used to obtain the sample attention feature of the sample association basic attribute on the sample basic attribute for any one of the plurality of sample basic attributes, based at least on the sample attribute features of the plurality of sample basic attributes, so as to obtain the sample attention feature corresponding to the sample basic attribute. The logistics attribute determination network is used to determine the logistics attribute of the sample logistics object from among the multiple candidate logistics attributes based on the sample relevance features and the sample attention features corresponding to each of the multiple sample basic attributes.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Training method, generating method, searching method and system of commodity attribute generating model
CN110968775A
Object type prediction method and device and storage medium
CN113159840A