Text classification algorithm-based logistics waybill number identification method and related equipment

Through the method based on text classification algorithm, the FastText recognition model is used to identify logistics waybill numbers, which solves the problems of low recognition accuracy and high complexity in the prior art, and achieves higher recognition accuracy and simplified user operation process.

CN119719367APending Publication Date: 2025-03-28深圳市领星网络科技有限公司
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411621230.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-14
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The prior art has low accuracy when identifying logistics waybill numbers. Especially when facing emerging express logistics companies and new waybill numbers, and when querying information on different stages of the same logistics order number from multiple channels and multiple logistics companies, unified identification becomes complicated.

Method used

Using a text classification algorithm based on the text classification algorithm, the logistics waybill number to be identified is analyzed through the FastText identification model, the attribution probability value belonging to multiple preset logistics companies is calculated, and N logistics companies to be selected are selected for users to choose, and the logistics waybill information corresponding to the target attribution logistics company selected by the user is finally displayed.

Benefits of technology

It improves the accuracy of logistics waybill number identification, simplifies user operation processes, helps users easily select corresponding logistics companies based on actual needs, and obtain corresponding logistics waybill information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719367A_ABST
    Figure CN119719367A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of logistics information processing, in particular to a logistics waybill number identification method based on a text classification algorithm and related equipment. The method specifically comprises the following steps: inputting a to-be-identified logistics waybill number into a FastText identification model to obtain an affiliation probability value of the to-be-identified logistics waybill number belonging to each logistics company in a plurality of preset logistics companies, then determining N to-be-selected logistics companies from the plurality of preset logistics companies according to the affiliation probability value, and then determining the number of the to-be-identified logistics waybill number according to the N to-be-selected logistics companies. Selecting a target affiliation logistics company from the N to-be-selected logistics companies according to a selection instruction of a user, and finally displaying logistics waybill information corresponding to the to-be-identified logistics waybill number according to the to-be-identified logistics waybill number and the target affiliation logistics company. According to the scheme of the invention, the accuracy of identification of the logistics waybill number can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of logistics information processing, and in particular to a method for identifying logistics waybill numbers based on a text classification algorithm and related equipment. Background Art

[0002] With the rapid development of e-commerce and cross-border e-commerce, the demand for cross-border logistics has also increased. Each e-commerce platform and personal website needs to provide timely logistics status tracking and query services to their users. There are thousands of different types of logistics companies around the world, and they each have different waybill numbers for users to query the status of logistics services. In order to solve the problem of logistics waybill number attribution identification in the prior art, by sorting out and collecting the number rules of each logistics company, and using fixed features such as digits and characters for identification, it is determined which logistics company the logistics waybill number belongs to.

[0003] However, under different logistics conditions, the same logistics order number may have its logistics information found in multiple logistics companies, such as first-leg logistics and freight forwarding in China, and last-leg logistics abroad. These situations make the existing identification methods difficult to use when facing new express logistics companies and new waybill numbers, especially when it is necessary to query different stages of information on the same logistics order number from multiple channels and multiple logistics companies. This makes unified identification complicated. For example, some companies use a combination of letters and numbers, while other companies may only use numbers. In addition, the length and structure of the waybill number may also be different, which leads to a low accuracy rate in logistics waybill number recognition. Summary of the invention

[0004] In order to improve the accuracy of logistics waybill number recognition, the present application provides a logistics waybill number recognition method and related equipment based on a text classification algorithm, which adopts the following technical solutions: In a first aspect, the present application provides a method for identifying a logistics waybill number based on a text classification algorithm, comprising: Input the logistics waybill number to be identified into the FastText recognition model to obtain the attribution probability value of the logistics waybill number to be identified to each of the preset multiple logistics companies, wherein the FastText recognition model is a recognition model obtained by pre-training a training sample set using the FastText algorithm, and each training sample in the training sample set includes multiple logistics waybill numbers and the logistics company corresponding to each of the multiple logistics waybill numbers; Determine N to-be-selected logistics companies from the preset multiple logistics companies according to the attribution probability value, where N is an integer greater than or equal to 1; Selecting a target logistics company from the N logistics companies to be selected according to the user's selection instruction; The logistics waybill information corresponding to the logistics waybill number to be identified is displayed according to the logistics waybill number to be identified and the target logistics company.

[0005] Optionally, the method further includes: Get historical order data within the target time period; Filtering the historical order data according to a predetermined rule, and determining the filtered historical order data as logistics sample data; performing text preprocessing on the logistics sample data according to training parameters to obtain the training sample set; Based on the FastText algorithm, the initial recognition model is trained using the training sample set to obtain the FastText recognition model.

[0006] Optionally, performing text preprocessing on the logistics sample data according to the training parameters to obtain the training sample set includes: Divide the target logistics sample into logistics waybill number information and logistics company information, wherein the target logistics sample is any one of the logistics sample data; Performing text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number; Determine the classification label according to the logistics company information; The training sample set is obtained based on the formatted waybill number and the classification label.

[0007] Optionally, after performing text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number, the method further includes: Counting the regular probability of each field in the formatted waybill number corresponding to the first logistics company appearing in the target training sample subset, where the first logistics company is any one of the preset multiple logistics companies, and the target training sample subset is the training sample subset corresponding to the first logistics company in the training sample set; The various fields, the rule probability and the first logistics company are associated and stored in a tracking number rule library.

[0008] Optionally, the performing text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number includes: Determine the length characteristics and preset characters corresponding to the logistics waybill number information; Dividing the logistics waybill number information based on the training parameters to obtain divided waybill numbers; The divided tracking number, the length feature and the preset character are combined to obtain the formatted waybill number.

[0009] Optionally, the determining of the preset characters corresponding to the logistics waybill number information includes: Determine the order number naming rule of the second logistics company corresponding to the logistics waybill number information; Determining whether the logistics waybill number information includes the attribute information of the second logistics company and / or the address information corresponding to the logistics waybill number information according to the waybill number naming rule; If yes, extracting the character combination corresponding to the attribute information and / or the address information, and determining the character combination as the preset character; If not, a preset number of characters in the logistics waybill number are extracted as the preset characters.

[0010] Optionally, before performing text preprocessing on the logistics sample data according to the training parameters to obtain the training sample set, the method includes: Determining whether a setting instruction of the user is received; If the setting instruction of the user is not received, determining the training parameters according to preset configuration data; If the setting instruction of the user is received, the preset configuration data is adjusted according to the setting instruction, and the adjusted preset configuration data is determined as the training parameter.

[0011] In a second aspect, the present application provides a device for identifying a logistics waybill number based on a text classification algorithm, comprising: an identification module, used to input a logistics waybill number to be identified into a FastText recognition model to obtain an attribution probability value of the logistics waybill number to be identified belonging to each of a plurality of preset logistics companies, wherein the FastText recognition model is a recognition model obtained by pre-training a training sample set using a FastText algorithm, wherein each training sample in the training sample set includes a plurality of logistics waybill numbers and a logistics company corresponding to each of the plurality of logistics waybill numbers; A determination module, configured to determine N to-be-selected logistics companies from the preset multiple logistics companies according to the attribution probability value, wherein N is an integer greater than or equal to 1; A processing module is used to select a target logistics company from the N selected logistics companies according to the user's selection instructions; a display module is used to display the logistics waybill information corresponding to the logistics waybill number to be identified according to the logistics waybill number to be identified and the target logistics company.

[0012] In a third aspect, the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for identifying logistics waybill numbers based on a text classification algorithm when executing the computer program.

[0013] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-mentioned method for identifying logistics waybill numbers based on a text classification algorithm.

[0014] To sum up, it can be seen that in the embodiment provided by the present application, the training sample set is first trained by the FastText algorithm to obtain the FastText recognition model, and the attribution probability value of the logistics waybill number to be identified belonging to each of the preset multiple logistics companies is calculated by the pre-trained FastText recognition model, and N selected logistics companies are screened out for user selection based on the size of the attribution probability value, and then the target attributable logistics company is determined from the N selected logistics companies according to the user's selection instruction, and finally the logistics waybill information corresponding to the target attributable logistics company selected by the user is displayed; the scheme in the present application not only improves the accuracy of logistics waybill number recognition, but also simplifies the user operation process, which can help users easily select the corresponding logistics company according to actual needs, and obtain the corresponding logistics waybill information displayed to the user. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a virtual structural diagram of a logistics waybill number recognition system based on a text classification algorithm provided in an embodiment of the present application; Figure 2 It is a flow chart of a method for identifying a logistics waybill number based on a text classification algorithm provided in an embodiment of the present application; Figure 3 It is a FastText model architecture diagram in the embodiment of the present application; Figure 4 This is a schematic diagram of hierarchical softmax in an embodiment of the present application; Figure 5 It is a schematic diagram of the matter feature in the embodiment of the present application; Figure 6 This is a schematic diagram of formatting a waybill number in an embodiment of the present application; Figure 7 It is a virtual structural diagram of a logistics waybill number recognition device based on a text classification algorithm provided in an embodiment of the present application. DETAILED DESCRIPTION

[0016] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more listed items.

[0017] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0018] First, in the process of research and practice of existing technologies, it was found that the existing parsing methods are not only inconvenient to use and have low recognition accuracy, but also cannot support newly emerging express logistics companies and the waybill numbers newly added by logistics companies; secondly, the search and matching based on the rule library are invalid calculations before the results are obtained, resulting in a waste of computing resources; finally, in cross-border logistics practice, it is necessary to query the different stages of information of the same logistics number from multiple channels and multiple logistics providers at the same time, and the existing parsing and recognition methods cannot meet the needs.

[0019] Reference Figure 1 , Figure 1 A virtual structural diagram of a logistics waybill number recognition system based on a text classification algorithm provided in an embodiment of the present application; in order to perform model training, a training module is first required to collect a training sample set, which should at least include a logistics waybill number and its corresponding logistics provider. During actual operation, paired samples of correctly identified waybill numbers and their corresponding logistics providers can be uploaded to update the exclusive recognition model in the cloud. In addition, the system supports downloading general models in the cloud, and users can also select different versions of models to identify the logistics provider to which the waybill number belongs. This means that the system will have a model library containing multiple iterative versions of models, and users can select any model from the model library for use when performing recognition.

[0020] After selecting the corresponding recognition model, the user input module transmits the query order number input by the user to the model recognition module. The module returns the list of identified logistics providers and the corresponding probability of each logistics provider to the user input module for the user to select a suitable logistics provider. Based on the logistics provider and logistics order number information selected by the user, the system will query the logistics information and display the relevant logistics information in the configuration center module, so that users can obtain information on the same logistics number at different stages.

[0021] In addition, the configuration center module stores preset configuration data, and model recognition can be performed based on these data. The module can receive user adjustment instructions and set parameters for each link of the system based on these instructions.

[0022] The embodiment of the present application discloses a method for identifying logistics waybill numbers based on a text classification algorithm.

[0023] Reference Figure 2 , Figure 2 A flow chart of a method for identifying a logistics waybill number based on a text classification algorithm provided in an embodiment of the present application, the method comprising the following steps: S10, inputting the logistics waybill number to be identified into the FastText recognition model to obtain the attribution probability value of the logistics waybill number to be identified to each of the preset multiple logistics companies, the FastText recognition model is a recognition model obtained by pre-training a training sample set using the FastText algorithm, and each training sample in the training sample set includes multiple logistics waybill numbers and the logistics company corresponding to each of the multiple logistics waybill numbers; The logistics waybill number to be identified is input into the FastText recognition model to obtain the probability value of the waybill number belonging to each of the preset multiple logistics companies. In this way, the model can analyze the characteristics of the waybill number and calculate its probability corresponding to each logistics company, helping users to quickly determine the ownership of the waybill number; The trained FastText recognition model can more accurately identify and classify logistics waybill numbers, thereby reducing recognition errors and improving the reliability of the overall system. The model can process a large number of waybill number recognition requests in a short period of time, ensuring that users can quickly obtain logistics information and improve user experience.

[0024] In one embodiment, by continuously uploading new recognition samples, the model can continue to learn and optimize, thereby improving recognition accuracy and adapting to changes in different logistics companies. The FastText recognition model can handle waybill numbers of different formats and features. By training on a variety of training samples, the model's adaptability to new data is improved. Based on the attribution probability value provided by the model, users can select the corresponding logistics company, thereby optimizing the logistics query and decision-making process.

[0025] In one embodiment, step S10 further includes: Get historical order data within the target time period; Filter the historical order data according to a predetermined rule, and determine the filtered historical order data as logistics sample data; Perform text preprocessing on the logistics sample data according to the training parameters to obtain a training sample set; Based on the FastText algorithm, the initial recognition model is trained through a training sample set to obtain a FastText recognition model.

[0026] In this embodiment, historical order data within a target time period is extracted from a database or an order management system. These data usually include information such as waybill numbers and logistics companies. Filtering rules are set according to business needs. For example, invalid waybill numbers, duplicate orders, or orders that exceed a time range are removed. The filtered orders are used as logistics sample data to ensure the quality and representativeness of the data. Then, text processing is performed on the logistics sample data based on training parameters (such as learning rate, number of training rounds, etc.), and the preprocessed samples are organized into a training sample set, which usually includes input (waybill number and related information) and output (corresponding logistics company). The initial recognition model is trained using the preprocessed training sample set using the FastText algorithm.

[0027] Specifically, historical order data within the target time period is obtained, and appropriate logistics sample data is screened out according to predetermined rules. By preprocessing the logistics sample data according to the training parameters, the obtained training sample set enables the recognition model trained based on the FastText algorithm to have a higher accuracy rate, thereby improving the recognition accuracy of the logistics company to which the logistics waybill number to be identified belongs.

[0028] In one embodiment, the step of performing text preprocessing on the logistics sample data according to the training parameters to obtain a training sample set includes: The target logistics sample is divided into logistics waybill number information and logistics company information, wherein the target logistics sample is any piece of data in the logistics sample data; Perform text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number; Determine the classification label based on the logistics company information; A training sample set is obtained based on the formatted waybill number and classification label.

[0029] In this embodiment, the target logistics samples are divided into logistics waybill number information and logistics company information, and the logistics waybill number information is text preprocessed based on the training parameters to obtain the formatted waybill number, and then the classification label is determined according to the logistics company information. Finally, a training sample set is obtained based on the formatted waybill number and the classification label, thereby improving the accuracy and effectiveness of the training sample set, so that the trained FastText recognition model can more accurately identify the logistics company to which the logistics waybill number to be identified belongs.

[0030] In one embodiment, before the step of performing text preprocessing on the logistics waybill number information based on the training parameters to obtain the formatted waybill number, the following steps are further performed: Determine whether a setting instruction from the user is received; If no setting instruction from the user is received, the training parameters are determined according to the preset configuration data; If a setting instruction from the user is received, the preset configuration data is adjusted according to the setting instruction, and the adjusted preset configuration data is determined as the training parameters.

[0031] In this embodiment, it is first determined whether the user's setting instructions are received. If the user's setting instructions are not received, the system automatically determines the training parameters based on the preset configuration data. Conversely, if the user's setting instructions are received, the preset configuration data will be adjusted according to the setting instructions, and the adjusted data will be used as training parameters. This design ensures that the training parameters can be flexibly set according to different needs, thereby improving the flexibility and applicability of the model training process.

[0032] The user provides training parameters through commands or configuration files. For example, the user can provide the following instructions: whether to perform word segmentation; whether to remove stop words; whether to convert to lowercase; the number of epochs for training; learning rate and other hyperparameters.

[0033] In one embodiment, after performing text preprocessing on the logistics waybill number information based on the training parameters to obtain the formatted waybill number, the following steps are further performed: Count the regular probabilities of each field in the formatted waybill number corresponding to the first logistics company appearing in the target training sample subset, where the first logistics company is any one of the preset multiple logistics companies, and the target training sample subset is the training sample subset corresponding to the first logistics company in the training sample set; Each field, rule probability and first logistics company are associated and stored in the order number rule library.

[0034] In this embodiment, the rule probability of each field in the formatted waybill number corresponding to the first logistics company appearing in the target training sample subset is counted, and each field, rule probability and the first logistics company are associated and stored in the waybill number rule library, which can improve the accuracy and adaptability of the recognition model and facilitate more accurate recognition and classification of waybill numbers of different logistics companies in the future.

[0035] An example of rule probability is given below: SF Express order number is composed of 12 digits. The first 3 digits are the area code, which varies in different areas. The middle is the express code, which is used for anti-counterfeiting. The last digit is the microcomputer identification code, which cycles from 0 to 9. Area code (first 3 digits): These 3 digits represent the starting area of ​​the express delivery. Different areas have different codes, for example, "001" may represent Beijing, and "002" may represent Shanghai. The area code is set by SF Express and is limited in number. Example: 001-Beijing; 002-Shanghai; 003-Guangzhou.

[0036] Different express delivery companies have different tracking number rules. For example, YTO Express may have different digits or different coding methods; ZTO Express may use a longer or shorter tracking number structure, or a different regional code system. By analyzing the structure of SF Express tracking numbers, we can understand how to calculate the regular probabilities of each part, and how to use these probabilities to estimate the uniqueness and validity of the tracking number. This analysis is not only applicable to SF Express, but can also be extended to other express delivery companies to calculate the corresponding probabilities by understanding their rules.

[0037] In one embodiment, the step of performing text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number includes: Determine the length characteristics and preset characters corresponding to the logistics waybill number information; Divide the logistics waybill number information based on the training parameters to obtain the divided waybill number; The divided tracking number, length feature and preset characters are combined to obtain the formatted waybill number.

[0038] In this embodiment, the logistics waybill number information can be efficiently preprocessed to obtain a formatted waybill number with a unified format, thereby improving the accuracy and efficiency of subsequent FastText recognition model training. Specifically, the length characteristics and preset characters of the logistics waybill number information are determined, and the logistics waybill number information is divided based on the training parameters to obtain the divided waybill number. Finally, the divided waybill number, length characteristics, and preset characters are merged into the formatted waybill number, ensuring the consistency of the training sample set and further improving the accuracy of model recognition.

[0039] like Figure 3 As shown, Figure 3 is the FastText model architecture diagram in the embodiment of this application, where x1, x2, ..., x N-1 , x N Represents an n-gram vector in a text. Each feature is the average of the word vectors, and all n-grams are used to predict the specified category.

[0040] like Figure 4 As shown, Figure 4 This is a schematic diagram of hierarchical softmax in the embodiment of this application; the softmax function is also called the normalized exponential function. In practice, class imbalance is often real and common; FastText cleverly uses this fact to establish a tree structure for characterizing categories by using the Huffman algorithm. Therefore, the depth of the tree structure that appears frequently is smaller than the depth of the tree structure of the infrequently appearing category, which further improves the overall computational efficiency.

[0041] For the n-gram of a text sentence, as mentioned above, it can be at the word level or at the character level. At the same time, n-gram can also work at the character level. For example, for a single word matter, assuming that 3-gram features are used, then matter can be expressed as Figure 5 There are five 3-gram features in Figure 5 This is a schematic diagram of the matter feature in an embodiment of the present application. The five features have their own word vectors, and the sum of the word vectors of the five features is the word matter. “<” and ">” are added as boundary symbols to distinguish the ngrams of a word from the word itself.

[0042] Process the order number into a statement example Figure 6 , Figure 6 This is a schematic diagram of formatting the waybill number in the embodiment of this application. After processing, it can be regarded as a natural language text input, and the task is to classify it, that is, to identify which logistics company it belongs to.

[0043] In one embodiment, the step of determining the preset characters corresponding to the logistics waybill number information includes: Determine the order number naming rules of the second logistics company corresponding to the logistics waybill number information; Determine whether the logistics waybill number information contains the attribute information of the second logistics company and / or the address information corresponding to the logistics waybill number information according to the waybill number naming rules; If yes, extracting the character combination corresponding to the attribute information and / or address information, and determining the character combination as a preset character; If not, a preset number of characters in the logistics waybill number are extracted as preset characters.

[0044] In this embodiment, the preset characters can be determined according to the logistics company's order number naming rules corresponding to the logistics waybill number information. When the logistics waybill number information contains specific attribute information or address information, the corresponding character combination is extracted as the preset characters, otherwise a preset number of characters are extracted as the preset characters, thereby improving the accuracy and flexibility of text preprocessing.

[0045] First, we need to clarify the second logistics company's waybill number naming rules, which involve how the logistics company constructs and formats its waybill numbers, including specific prefixes, suffixes, character combinations, and character lengths. Understanding these rules can help us identify whether the waybill number conforms to the company's format.

[0046] According to the determined order number naming rules, check whether the provided logistics waybill number information contains the relevant attribute information of the second logistics company, including: the logistics company's unique identifier (such as a specific letter or number combination) and the structural characteristics of the waybill number; at the same time, confirm whether the waybill number information contains address information related to logistics, which may involve extracting place names or specific geographic information from the waybill number.

[0047] If the waybill number does contain the attribute information or address information of the second logistics company, the corresponding character combinations must be extracted from it. These character combinations can be the parts of the waybill number that comply with the naming rules. The extracted character combinations will be confirmed as "preset characters" and may be used for further processing or identification. If the waybill number does not contain any qualifying attribute information or address information, a preset number of characters are extracted from the waybill number as preset characters. This number should be specified when the steps are designed and can be set according to actual needs. Through the above steps, important information can be effectively identified and extracted from the logistics waybill number for subsequent logistics processing and tracking. This process not only improves the accuracy of information processing, but also ensures adaptability and flexibility among different logistics companies.

[0048] S20, determining N to-be-selected logistics companies from a plurality of preset logistics companies according to the attribution probability values, where N is an integer greater than or equal to 1; Among them, the attribution probability value is an evaluation indicator for each logistics company, reflecting the matching degree between a specific logistics company and a given waybill or package. The probability value is usually between 0 and 1, and the higher the value, the higher the matching degree; presetting multiple logistics companies, that is, defining a list containing multiple logistics companies, each company has a corresponding attribution probability value, and sorting the preset logistics companies in descending order according to the attribution probability value of each logistics company, ensuring that the company with the highest probability value is ranked first, and then, selecting the first N companies from the sorted list of logistics companies as the selected logistics companies, and recording the selected N logistics companies and their attribution probability values ​​for subsequent processing or display. The following is an example: Assume that there are the following preset logistics companies and their belonging probability values: Logistics Company: Attribution Probability Value: Company A (0.85); Company B (0.75); Company C (0.90); Company D (0.80).

[0049] Set N = 2, after sorting: Company C (0.90); Company A (0.85); Company D (0.80); Company B (0.75).

[0050] Selected logistics company: Company C (0.90); Company A (0.85).

[0051] The above steps ensure that N candidate companies are accurately selected from multiple logistics companies according to the attribution probability values. This process improves the efficiency of users in selecting logistics companies and provides data support for decision-making.

[0052] S30, selecting a target logistics company from N logistics companies to be selected according to the user's selection instruction; Among them, the N logistics companies to be selected are obtained from the previous steps. Assume that the N logistics companies to be selected include: Company C (0.90); Company A (0.85). According to the user's selection instructions, the final target logistics company is confirmed. The user's selection instructions can be in various forms, for example: select a specific logistics company (such as selecting "Company A"); make recommendations based on the user's historical choices (such as "select the company I used last time").

[0053] S40: Display the logistics waybill information corresponding to the logistics waybill number to be identified according to the logistics waybill number to be identified and the target logistics company.

[0054] Among them, the logistics waybill number and target logistics company to be identified are determined and the corresponding logistics waybill information is displayed. The logistics waybill information includes but is not limited to: waybill number: a number that uniquely identifies each package; logistics company: the name of the logistics company that transports the package; package status: the current transportation status of the package (such as collected, in transit, being delivered, signed for, etc.); shipper information (name, address, telephone number, etc.) and consignee information; transportation time: time record of each transportation link (such as collection time, transportation time, signing time); package weight and size: relevant package information, including weight and volume, etc.

[0055] The above describes the embodiment of the present application from the perspective of the method for identifying the logistics waybill number based on the text classification algorithm. The following describes the embodiment of the present application from the perspective of the device for identifying the logistics waybill number based on the text classification algorithm. Please refer to Figure 7 , Figure 7 A virtual structural diagram of a device for identifying a logistics waybill number based on a text classification algorithm provided in an embodiment of the present application, wherein the device 700 for identifying a logistics waybill number based on a text classification algorithm includes: The identification module 701 is used to input the logistics waybill number to be identified into the FastText identification model to obtain the attribution probability value of the logistics waybill number to be identified to each logistics company in the preset multiple logistics companies. The FastText identification model is a recognition model obtained by pre-training a training sample set through the FastText algorithm. Each training sample in the training sample set includes multiple logistics waybill numbers and the logistics company corresponding to each of the multiple logistics waybill numbers. A determination module 702 is used to determine N to-be-selected logistics companies from a plurality of preset logistics companies according to the attribution probability value, where N is an integer greater than or equal to 1; The processing module 703 is used to select a target logistics company from N selected logistics companies according to the user's selection instructions; the display module 704 is used to display the logistics waybill information corresponding to the logistics waybill number to be identified according to the logistics waybill number to be identified and the target logistics company.

[0056] In this embodiment, the training sample set is first trained by the FastText algorithm to obtain the FastText recognition model. The recognition module calculates the attribution probability value of the logistics waybill number to be identified belonging to each of the preset multiple logistics companies through the pre-trained FastText recognition model. The determination module selects N selected logistics companies for the user to choose according to the size of the attribution probability value. Then the processing module determines the target attributable logistics company from the N selected logistics companies according to the user's selection instruction. Finally, the display module displays the logistics waybill information corresponding to the target attributable logistics company selected by the user. The solution in this application not only improves the accuracy of logistics waybill number recognition, but also simplifies the user operation process, which can help users easily select the corresponding logistics company according to actual needs, and obtain the corresponding logistics waybill information displayed to the user.

[0057] In a possible implementation manner, the identification module 701 is specifically used for: Get historical order data within the target time period; Filter the historical order data according to a predetermined rule, and determine the filtered historical order data as logistics sample data; Perform text preprocessing on the logistics sample data according to the training parameters to obtain a training sample set; Based on the FastText algorithm, the initial recognition model is trained through a training sample set to obtain a FastText recognition model.

[0058] In a possible implementation manner, the identification module 701 is further specifically configured to: The target logistics sample is divided into logistics waybill number information and logistics company information, wherein the target logistics sample is any piece of data in the logistics sample data; Perform text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number; Determine the classification label based on the logistics company information; A training sample set is obtained based on the formatted waybill number and classification label.

[0059] In a possible implementation manner, the identification module 701 is further specifically configured to: Count the regular probabilities of each field in the formatted waybill number corresponding to the first logistics company appearing in the target training sample subset, where the first logistics company is any one of the preset multiple logistics companies, and the target training sample subset is the training sample subset corresponding to the first logistics company in the training sample set; Each field, rule probability and first logistics company are associated and stored in the order number rule library.

[0060] In a possible implementation manner, the identification module 701 is further specifically configured to: Determine the length characteristics and preset characters corresponding to the logistics waybill number information; Divide the logistics waybill number information based on the training parameters to obtain the divided waybill number; The divided tracking number, length feature and preset characters are combined to obtain the formatted waybill number.

[0061] In a possible implementation manner, the identification module 701 is further specifically configured to: Determine the order number naming rules of the second logistics company corresponding to the logistics waybill number information; Determine whether the logistics waybill number information contains the attribute information of the second logistics company and / or the address information corresponding to the logistics waybill number information according to the waybill number naming rules; If yes, extracting the character combination corresponding to the attribute information and / or address information, and determining the character combination as a preset character; If not, a preset number of characters in the logistics waybill number are extracted as preset characters.

[0062] In a possible implementation manner, the identification module 701 is further specifically configured to: Determine whether a setting instruction from the user is received; If no setting instruction from the user is received, the training parameters are determined according to the preset configuration data; If a setting instruction from the user is received, the preset configuration data is adjusted according to the setting instruction, and the adjusted preset configuration data is determined as the training parameters.

[0063] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0064] It can be understood by a person skilled in the art that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0065] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.

Claims

1. A method for identifying logistics waybill numbers based on text classification algorithm, characterized in that: include: Input the logistics waybill number to be identified into the FastText recognition model to obtain the attribution probability value of the logistics waybill number to be identified to each of the preset multiple logistics companies, wherein the FastText recognition model is a recognition model obtained by pre-training a training sample set using the FastText algorithm, and each training sample in the training sample set includes multiple logistics waybill numbers and the logistics company corresponding to each of the multiple logistics waybill numbers; Determine N to-be-selected logistics companies from the preset multiple logistics companies according to the attribution probability value, where N is an integer greater than or equal to 1; Selecting a target logistics company from the N logistics companies to be selected according to the user's selection instruction; The logistics waybill information corresponding to the logistics waybill number to be identified is displayed according to the logistics waybill number to be identified and the target logistics company.

2. The method according to claim 1, characterized in that The method further comprises: Get historical order data within the target time period; Filtering the historical order data according to a predetermined rule, and determining the filtered historical order data as logistics sample data; Performing text preprocessing on the logistics sample data according to the training parameters to obtain the training sample set; Based on the FastText algorithm, the initial recognition model is trained using the training sample set to obtain the FastText recognition model.

3. The method according to claim 2, characterized in that The performing text preprocessing on the logistics sample data according to the training parameters to obtain the training sample set includes: Divide the target logistics sample into logistics waybill number information and logistics company information, wherein the target logistics sample is any one of the logistics sample data; Performing text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number; Determine the classification label according to the logistics company information; The training sample set is obtained based on the formatted waybill number and the classification label.

4. The method according to claim 3, characterized in that After performing text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number, the method further includes: Counting the regular probability of each field in the formatted waybill number corresponding to the first logistics company appearing in the target training sample subset, where the first logistics company is any one of the preset multiple logistics companies, and the target training sample subset is the training sample subset corresponding to the first logistics company in the training sample set; The various fields, the rule probability and the first logistics company are associated and stored in a tracking number rule library.

5. The method according to claim 3, characterized in that: The performing text preprocessing on the logistics waybill number information based on the training parameters to obtain a formatted waybill number includes: Determine the length characteristics and preset characters corresponding to the logistics waybill number information; Dividing the logistics waybill number information based on the training parameters to obtain divided waybill numbers; The divided tracking number, the length feature and the preset character are combined to obtain the formatted waybill number.

6. The method according to claim 5, characterized in that The predetermined characters corresponding to the logistics waybill number information are determined to include: Determine the order number naming rule of the second logistics company corresponding to the logistics waybill number information; Determining whether the logistics waybill number information includes the attribute information of the second logistics company and / or the address information corresponding to the logistics waybill number information according to the waybill number naming rule; If yes, extracting the character combination corresponding to the attribute information and / or the address information, and determining the character combination as the preset character; If not, a preset number of characters in the logistics waybill number are extracted as the preset characters.

7. The method according to claim 2, characterized in that Before performing text preprocessing on the logistics sample data according to the training parameters to obtain the training sample set, the method includes: Determining whether a setting instruction of the user is received; If the setting instruction of the user is not received, determining the training parameters according to preset configuration data; If the setting instruction of the user is received, the preset configuration data is adjusted according to the setting instruction, and the adjusted preset configuration data is determined as the training parameter.

8. A device for identifying logistics waybill numbers based on a text classification algorithm, characterized in that: include: An identification module is used to input the logistics waybill number to be identified into the FastText recognition model to obtain an attribution probability value of the logistics waybill number to be identified to each logistics company in a preset plurality of logistics companies, wherein the FastText recognition model is a recognition model obtained by pre-training a training sample set using the FastText algorithm, wherein each training sample in the training sample set includes a plurality of logistics waybill numbers and a logistics company corresponding to each of the plurality of logistics waybill numbers; A determination module, configured to determine N to-be-selected logistics companies from the preset multiple logistics companies according to the attribution probability value, wherein N is an integer greater than or equal to 1; A processing module, configured to select a target logistics company from the N logistics companies to be selected according to a selection instruction of a user; A display module is used to display the logistics waybill information corresponding to the logistics waybill number to be identified according to the logistics waybill number to be identified and the target logistics company.

9. A computer device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the method for identifying a logistics waybill number based on a text classification algorithm described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for identifying logistics waybill numbers based on a text classification algorithm described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • A tree structure-based logistics company identification method and system

    CN122527379A