Dual-address text recognition method, device, computer equipment and storage medium
By segmenting and matching the address text of the logistics waybill, combined with regular filtering processing, the dual address text is identified, which solves the problem of low identification accuracy in the existing technology and improves the efficiency of logistics order distribution and freight accounting.
Patent Information
- Application Number
- CN202011285208.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-17
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2040-11-17
AI Technical Summary
Existing address text recognition technology is difficult to accurately identify the address input information and dual-address text in various orders and no universal standard format in the logistics field, resulting in low recognition accuracy.
By segmenting the initial address text of the logistics waybill, using the pre-built address vocabulary for matching, the target segmentation of each target region level is determined, and through two splitting and regular filtering processes, the dual address text is identified.
The accuracy of address text recognition is improved to ensure the efficiency of logistics order distribution and freight accounting.
Smart Images

Figure CN114510935B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text processing, and in particular to a dual-address text recognition method, device, computer equipment and storage medium. Background Art
[0002] With the development of computer technology, the logistics industry has developed rapidly. Logistics address text recognition has become a key point in the logistics field. Through logistics address recognition, the collection and delivery range of logistics orders can be obtained, thereby improving the efficiency of logistics order allocation and logistics freight calculation. Existing address text recognition determines the delivery range of logistics orders by splitting and identifying the address.
[0003] However, in the logistics field, logistics addresses have diverse address input information and order, and there is no universal standard format; there is repeated province, city, and district information in the address information, and the province, city, and district information before and after are inconsistent in the waybill (i.e., double address text), resulting in the inability of existing address text recognition technology to accurately recognize double address text. Summary of the invention
[0004] Based on this, it is necessary to provide a dual-address text recognition method, device, computer equipment and storage medium that can improve the accuracy of address text recognition in response to the above technical problems.
[0005] A dual-address text recognition method, the method comprising:
[0006] Get the initial address text of the logistics waybill;
[0007] Perform word segmentation on the initial address text of the obtained logistics waybill to obtain a first word segmentation set;
[0008] According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-built address vocabulary, and a first target segmentation corresponding to each target regional level is determined from the first segmentation set;
[0009] Performing address segmentation on the initial address text according to each of the first target segmentation words to obtain segmented address text;
[0010] Performing word segmentation on the segmented address text to obtain a second word segmentation set;
[0011] According to the segmentation order of each segmentation in the second segmentation set, the second segmentation set is matched with a pre-built address vocabulary, and a second target segmentation corresponding to each target regional level is determined from the second segmentation set;
[0012] When the first target segmented word and the second target segmented word are different, it is determined that the initial address text is a dual address text.
[0013] In one embodiment, when the first target segmentation word and the second target segmentation word are different, determining that the initial address text is a dual address text includes:
[0014] When the first target segmented word and the second target segmented word are different, the segmented address text is subjected to regular filtering processing to obtain a processed address text; the regular filtering processing is used to filter the non-keyword segmented words in the address text whose similarity reaches a threshold;
[0015] Performing word segmentation on the processed address text to obtain a third word segmentation set;
[0016] According to the segmentation order of each segmentation in the third segmentation set, the third segmentation set is matched with a pre-constructed address vocabulary, and a third target segmentation corresponding to each target regional level is determined from the third segmentation set;
[0017] When the first target segmented word and the third target segmented word are different, it is determined that the initial address text is a dual address text.
[0018] In one embodiment, before performing word segmentation on the acquired initial address text of the logistics waybill to obtain the first word segmentation set, the method further includes:
[0019] The initial address text is detected, and when the font of the address text in the initial address text is not the target font, the font of the address text is converted to the target font or the address text is deleted from the initial address text to obtain a recognizable initial address text.
[0020] In one embodiment, matching the first segmented word set with a pre-built address word library according to the segmented order of each segmented word in the first segmented word set, and determining the first target segmented word corresponding to each target regional level from the first segmented word set includes:
[0021] Obtaining the priority and word limit of each target regional level;
[0022] Based on the priorities and the word count limit, the first word set is matched with a pre-built address vocabulary according to the word order of each word in the first word set, and the first target word corresponding to each target regional level is determined from the first word set.
[0023] In one embodiment, performing address segmentation on the initial address text according to each of the first target segmentation words to obtain segmented address text includes:
[0024] Determining the segmentation points of the initial address text according to each of the first target segmented words;
[0025] Based on the segmentation point, the initial address text is segmented to obtain segmented address text.
[0026] In one embodiment, the method for constructing the address vocabulary includes:
[0027] Obtain the historical address text and basic address vocabulary of logistics waybills within a preset time period;
[0028] Acquire target segmentations corresponding to each target regional level from the historical address text;
[0029] According to each of the target segmented words, fuzzy matching is performed on the historical address text and the basic address word library to obtain a matching result;
[0030] The basic address word library is updated according to the matching result to obtain an address word library.
[0031] In one embodiment, the method further comprises:
[0032] Generate prompt information of the initial address text;
[0033] According to the prompt information, the logistics resources corresponding to the initial address text are updated.
[0034] A dual-address text recognition device, the device comprising:
[0035] The acquisition module is used to obtain the initial address text of the logistics waybill;
[0036] The first splitting module is used to split the initial address text of the obtained logistics waybill into words to obtain a first word set;
[0037] A matching module, configured to match the first segmented word set with a pre-built address word library according to the segmentation order of each segmented word in the first segmented word set, and determine a target segmented word corresponding to a target regional level from the first segmented word set;
[0038] A segmentation module, configured to perform address segmentation on the initial address text according to the first target segmentation word to obtain segmented address text;
[0039] A second splitting module is used to split the segmented address text into words to obtain a second word set;
[0040] A detection module, configured to match the second segmented word set with a pre-built address word library according to the segmentation order of each segmented word in the second segmented word set, and detect whether the target segmented word exists in the segmented address text;
[0041] A determination module is used to determine that the initial address text is a dual address text when the target segmentation word exists in the segmented address text.
[0042] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0043] Get the initial address text of the logistics waybill;
[0044] Perform word segmentation on the initial address text of the obtained logistics waybill to obtain a first word segmentation set;
[0045] According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-built address vocabulary, and a first target segmentation corresponding to each target regional level is determined from the first segmentation set;
[0046] Performing address segmentation on the initial address text according to each of the first target segmentation words to obtain segmented address text;
[0047] Performing word segmentation on the segmented address text to obtain a second word segmentation set;
[0048] According to the segmentation order of each segmentation in the second segmentation set, the second segmentation set is matched with a pre-built address vocabulary, and a second target segmentation corresponding to each target regional level is determined from the second segmentation set;
[0049] When the first target segmented word and the second target segmented word are different, it is determined that the initial address text is a dual address text.
[0050] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:
[0051] Get the initial address text of the logistics waybill;
[0052] Perform word segmentation on the initial address text of the obtained logistics waybill to obtain a first word segmentation set;
[0053] According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-built address vocabulary, and a first target segmentation corresponding to each target regional level is determined from the first segmentation set;
[0054] Performing address segmentation on the initial address text according to each of the first target segmentation words to obtain segmented address text;
[0055] Performing word segmentation on the segmented address text to obtain a second word segmentation set;
[0056] According to the segmentation order of each segmentation in the second segmentation set, the second segmentation set is matched with a pre-built address vocabulary, and a second target segmentation corresponding to each target regional level is determined from the second segmentation set;
[0057] When the first target segmented word and the second target segmented word are different, it is determined that the initial address text is a dual address text.
[0058] The above-mentioned dual-address text recognition method, device, computer equipment and storage medium perform word segmentation and splitting on the initial address text of the obtained logistics waybill to obtain the split words of the initial address text, that is, the first word segmentation set, and match the first word segmentation set with a pre-constructed address word library according to the word segmentation order of each word in the first word segmentation set, and determine the first target word segmentation corresponding to each target geographical level from the first word segmentation set; perform address segmentation on the initial address text according to each first target word segmentation to obtain a segmented address text; perform word segmentation and splitting on the segmented address text to obtain a second word segmentation set; match the second word segmentation set with the pre-constructed address word library, and when the matched second target is different from the first target word segmentation, determine that the initial address text is a dual address text; that is, by pre-constructing an address word library, split the address text of the logistics waybill twice, match the first word segmentation set and the second word segmentation set with the address word library to obtain the first target word segmentation and the second target word segmentation, and determine the dual address text by detecting whether the first target word segmentation is the same as the second target word segmentation, thereby improving the accuracy of address text recognition. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 is an application environment diagram of a dual-address text recognition method in one embodiment;
[0060] Figure 2 A schematic diagram of a flow chart of a dual-address text recognition method in one embodiment;
[0061] Figure 3 A schematic diagram of a process for constructing an address vocabulary library in one embodiment;
[0062] Figure 4 A schematic diagram of a flow chart of a dual-address text recognition method in another embodiment;
[0063] Figure 5 A schematic diagram of a flow chart of a dual-address text recognition step in one embodiment;
[0064] Figure 6 is a structural block diagram of a dual-address text recognition device in one embodiment;
[0065] Figure 7 is a structural block diagram of a dual-address text recognition device in another embodiment;
[0066] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0068] The dual address text recognition method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 obtains the initial address text of the logistics waybill from the server 104; the initial address text of the logistics waybill obtained is segmented and split to obtain a first segmentation set; according to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-built address vocabulary, and the first target segmentation corresponding to each target regional level is determined from the first segmentation set; the initial address text is segmented according to each first target segmentation to obtain a segmented address text; the segmented address text is segmented to obtain a second segmentation set; according to the segmentation order of each segmentation in the second segmentation set, the second segmentation set is matched with a pre-built address vocabulary, and the second target segmentation corresponding to each target regional level is determined from the second segmentation set; when the first target segmentation and the second target segmentation are different, the initial address text is determined to be a double address text. The terminal 102 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0069] In one embodiment, Figure 2 As shown, a dual address text recognition method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0070] Step 202, obtaining the initial address text of the logistics waybill.
[0071] Step 204: perform word segmentation on the obtained initial address text of the logistics waybill to obtain a first word segmentation set.
[0072] Among them, the method of splitting the initial address text can be but not limited to using the Jieba word segmentation tool to split the initial address text, splitting the initial address text to obtain the corresponding first word segmentation set, and each word in the first word segmentation set has a corresponding word segmentation order; wherein, the principle of Jieba word segmentation is the existing technology and will not be repeated here. For example, the initial address text obtained is "No. 903, Huaxia Community, Chegongmiao, Shennan Avenue, Futian District, Shenzhen", and the first word segmentation set obtained by splitting is {Shenzhen, City, Futian, District, Shennan, Avenue, Chegongmiao, Huaxia, Community, No. 903}, wherein the word segmentation order corresponding to each word segmentation is 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11.
[0073] Specifically, the terminal obtains the initial address text of the logistics waybill from the server. Each initial address text has a corresponding logistics waybill number. The Jieba word segmentation tool is called to segment the initial address text to obtain the first word segmentation set of each initial address text.
[0074] Step 206 , matching the first segmented word set with a pre-built address word library according to the segmented order of each segmented word in the first segmented word set, and determining the first target segmented word corresponding to each target regional level from the first segmented word set.
[0075] Among them, the pre-built address word library includes multiple provincial, municipal and district information tables, which are separated according to provincial addresses, municipal addresses and district and county addresses. The target regional levels include province, city, district, county, etc. Each target regional level has corresponding matching logic data, which includes word segmentation limit, priority, separator word limit and null value completion limit, etc.; each target regional level has a corresponding matching priority, and the matching priority of the province is higher than that of the city, and the matching priority of the city is higher than that of the district and county.
[0076] Priority restriction means that after the Xth word segmentation matches the province, the X+1th word starts matching from the city level; when the province level is empty, the city level starts matching from the first word segmentation again. When the city level is empty, the district level starts matching from the point of the province level segmentation to the next one.
[0077] The word limit is the maximum allowed number of word matches at the target region level and the Nth word match. When there is no matching information for more than N words, the location unit is recorded as empty. For example, the word limit for the province location unit is 4. When none of the four words that can be used as a province appear, the province is recorded as empty.
[0078] The separator word limit refers to the maximum separator word limit between each target region level, that is, there is a maximum separator word limit between province and city, city and district, and province and district. For example, when the maximum separator word limit between province and city is set to 2, when the province matches the second word, the city can only match the third and fourth words, otherwise the record is empty.
[0079] The null value completion restriction means that when the previous level address match is empty, but the next level match is found, the previous level information can be completed based on the next level address vocabulary association. For example, if the province is not filled in, but the city is identified as Shenzhen, the province part is completed as Guangdong Province. If a city name is associated with multiple provinces, the association level of the next level district is considered; if there are multiple associations for the next level district, the target region level remains empty.
[0080] Specifically, according to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with the pre-constructed address vocabulary, and according to the corresponding matching logic data of each target regional level, the first target segmentation corresponding to each target regional level is determined from the first segmentation set, that is, when each target regional level is province, city, and district, the corresponding first target segmentation is obtained as province: XX, city: XX, district: XX.
[0081] Optionally, in one embodiment, the priority and word count limit of each target regional level are obtained; based on each priority and word count limit, the first word set is matched with a pre-built address vocabulary according to the word segmentation order of each word in the first word set, and the first target word corresponding to each target regional level is determined from the first word set; matching is performed according to the priority and word count limit of each target regional level, so that the accuracy of determining the first target word is improved.
[0082] Optionally, in one embodiment, before the initial address text of the obtained logistics waybill is segmented and split to obtain the first segmentation set, the initial address text is detected, and when the font of the address text in the initial address text is not the target font, the font of the address text is converted to the target font or the address text is deleted from the initial address text to obtain a recognizable initial address text. The target font can be, but is not limited to, simplified Chinese.
[0083] Specifically, before the initial address text of the acquired logistics waybill is segmented and split to obtain the first segmentation set, the initial address text is detected. When the initial address text has an address text in English font, English is deleted from the initial address text; when the initial address text has an address text in traditional Chinese font, the corresponding traditional Chinese characters are converted into simplified Chinese; by performing traditional Chinese character recognition and English recognition on the initial text address, deleting the English address text and converting the traditional Chinese address text into simplified Chinese address text, the obtained initial address text can be recognized, thereby improving the accuracy of address text recognition.
[0084] Step 208: segment the initial address text according to each first target word segmentation to obtain segmented address text.
[0085] Specifically, the segmentation point of the initial address text is determined according to each first target segmentation word; based on the segmentation point, the initial address text is segmented to obtain the segmented address text. That is, according to the matching province, city and district information, the matching text (i.e., each first target segmentation word) and the segmented address text are segmented, and the first matching text and the position of each target regional level are stored. For example, for the text "Apartment 303, 12 Shennan Road, Yuehai Street, Nanshan District, Shenzhen, Guangdong Province" is segmented, and it will be retained as {Province: Guangdong, City: Shenzhen, District: Nanshan, Province Position: 0, City Position: 3, District Position: 5, Segmented Address Text: Apartment 303, 12 Shennan Road, Yuehai Street}.
[0086] Step 210: perform word segmentation on the segmented address text to obtain a second word segmentation set.
[0087] Step 212, matching the second segmented word set with the pre-built address word library according to the segmented order of each segmented word in the second segmented word set, and determining the second target segmented word corresponding to each target regional level from the second segmented word set.
[0088] Specifically, according to the segmentation order of each word in the second segmentation set, the second segmentation set is matched with a pre-constructed address vocabulary. When it is detected that segmentation information corresponding to each target regional level exists in the segmented address text, the second target segmentation corresponding to each target regional level is determined from the second segmentation set; if segmentation information corresponding to each target regional level does not exist in the segmented address text, the initial text address is a normal address text.
[0089] Step 214: When the first target segmentation word and the second target segmentation word are different, it is determined that the initial address text is a dual address text.
[0090] In the above dual-address text recognition method, the initial address text of the obtained logistics waybill is segmented and split to obtain the split words of the initial address text, that is, the first segmentation set. According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-constructed address vocabulary, and the first target segmentation corresponding to each target geographical level is determined from the first segmentation set; the initial address text is segmented according to each first target segmentation to obtain a segmented address text; the segmented address text is segmented and split to obtain a second segmentation set; the second segmentation set is matched with the pre-constructed address vocabulary, and when the matched second target is different from the first target segmentation, the initial address text is determined to be a dual-address text; that is, by pre-constructing an address vocabulary, the address text of the logistics waybill is split twice, the first segmentation set and the second segmentation set are matched with the address vocabulary to obtain the first target segmentation and the second target segmentation, and the dual address text is determined by detecting whether the first target segmentation is the same as the second target segmentation, thereby improving the accuracy of address text recognition.
[0091] In one embodiment, Figure 3 As shown, a method for constructing an address word library is provided, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0092] Step 302, obtaining the historical address text and basic address vocabulary of the logistics waybill within a preset time period.
[0093] The basic address word library may be an information table obtained online including multiple provinces, cities and districts, and is classified into provincial addresses, municipal addresses, and district and county addresses. The historical address text is the express delivery address of the logistics company within a preset time period (for example, two months).
[0094] Specifically, a basic address word library and historical address texts are obtained from a remote server, the obtained address texts are classified according to provincial addresses, municipal addresses, district and county addresses, a captured word library is obtained, and the two word libraries are associated and matched.
[0095] Step 304: Obtain target segmentations corresponding to each target regional level from the historical address text.
[0096] Step 306: perform fuzzy matching on the historical address text and the basic address word library according to each target word segmentation to obtain a matching result.
[0097] Specifically, when there is a target segmentation in the grab vocabulary that is not in the basic address vocabulary, the historical address text and the basic address vocabulary are fuzzy matched based on each target regional level. If the character length of the target segmentation corresponding to the target regional level is within the preset character length range, and there are multiple characters that are the same and the target segmentations of adjacent target regional levels are the same (for example, the district-level address has multiple characters that are consistent, and the previous city-level and provincial-level information are consistent), then the target segmentation corresponding to the target regional level is used as the result of fuzzy matching. For example, Gulan County and Gulan Town are the same when the city is the same), so the units of length 3-5 are all replaced with the last character with '*', or removed, to match each other. If the character length is less than 3, no fuzzy matching will be performed. If the frequency of the character appears reaches the preset frequency, it is determined to be a high-frequency target segmentation, and the basic address vocabulary is updated according to the high-frequency target segmentation. If the character length is greater than 5 units, the missing matchable units are composed of homophones, or are converted to the first letters of pinyin for matching.
[0098] Step 308: Update the basic address word library according to the matching result to obtain an address word library.
[0099] In the above-mentioned method for constructing the address vocabulary, by obtaining the historical address text and basic address vocabulary of the logistics waybill within a preset time period, the target segmentation corresponding to each target geographical level is obtained from the historical address text, and according to each target segmentation, the historical address text and the basic address vocabulary are fuzzy matched to obtain a matching result, and the basic address vocabulary is updated according to the matching result to obtain the address vocabulary. By updating the basic address vocabulary, the integrity of the address vocabulary data and the accuracy of the data are ensured, thereby improving the accuracy of the address text.
[0100] In another embodiment, Figure 4 As shown, a dual address text recognition method is provided, which is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0101] Step 402, obtaining the initial address text of the logistics waybill.
[0102] Step 404: perform word segmentation on the obtained initial address text of the logistics waybill to obtain a first word segmentation set.
[0103] Step 406 , matching the first segmented word set with a pre-built address word library according to the segmented order of each segmented word in the first segmented word set, and determining the first target segmented word corresponding to each target regional level from the first segmented word set.
[0104] Step 408: segment the initial address text according to each first target word segmentation to obtain segmented address text.
[0105] Step 410: perform word segmentation on the segmented address text to obtain a second word segmentation set.
[0106] Step 412, matching the second segmented word set with the pre-built address word library according to the segmented order of each segmented word in the second segmented word set, and determining the second target segmented word corresponding to each target regional level from the second segmented word set.
[0107] Step 414: When the first target segmentation word and the second target segmentation word are different, regular filtering is performed on the segmented address text to obtain a processed address text.
[0108] Among them, regular filtering processing includes filtering non-keywords in address texts, segmentation words with similarity reaching a threshold, special characters, address texts with the same target segmentation words as the target segmentation words at the non-target regional level (e.g., filtering incorrect recognition caused by duplicate road names and province, city, and district names), etc.; filtering non-keywords in address texts means that the address does not include keywords such as [province]|[city]|[district]|[banner]|[league]|[town]|[county], which can avoid recognition errors caused by the same community segmentation words as the province and city segmentation words; segmentation words with similarity reaching a threshold means that commonly used special district words interfere with district keyword recognition, such as "development zone" and "new district"; filtering special characters in address texts means filtering waybills that use special words to avoid keyword detection, such as logistics address texts that should contain "community" and "market" but are judged to have district-level or higher keywords.
[0109] Optionally, in one embodiment, the regular filtering process includes special processing, that is, adjusting the word count limit in the corresponding matching logic data of each target regional level to a separation word limit. For example, the initial address text is "Jiayuguan City, Yumen District, Jiuquan City, Gansu Province, China Special Infrastructure No. 3 Astronomical Unit Jurisdiction". After word segmentation, Jiayuguan City will be hidden in a very backward position, exceeding the preset number of word segments. At this time, the word segmentation limit of "Jiuquan City, Gansu Province" recognized in the first round must be adjusted. By adjusting the word count limit to a separation word limit, the target word segmentation corresponding to the target regional level in the initial address text can be accurately identified, thereby improving the accuracy of address text recognition.
[0110] In one embodiment, the regular filtering process includes making a bottom-line adjustment based on the high-frequency anomalies in each province. The bottom-line adjustment is mainly for data that is repeatedly encountered but is difficult to filter with normal recognition logic. For example, there is a community in Futian District, Shenzhen City called "Bao'an District Builders' Dormitory", which will be identified as a double address in the existing logic. When this problem address appears multiple times, the bottom-line adjustment is to store a bottom-line database at the end. When the first round of the problem data is Futian District, Shenzhen City, if the subsequent cut address contains the substring "Bao'an District Builders' Dormitory", it will be removed from the problem data and not output; by performing a bottom-line processing on the data, the interference of other information on the target regional level information is avoided, so that the output double-address problem data has a very high accuracy rate.
[0111] Step 416, segment the address text to obtain a third segmentation set.
[0112] Step 418, matching the third segmented word set with the pre-built address word library according to the segmented order of each segmented word in the third segmented word set, and determining the third target segmented word corresponding to each target regional level from the third segmented word set.
[0113] Step 420: When the first target segmentation word and the third target segmentation word are different, determine that the initial address text is a dual address text.
[0114] Optionally, in one embodiment, when the first target segmentation word and the third target segmentation word are different, the initial address text is determined to be a dual address text; prompt information of the initial address text is generated; and the logistics resources corresponding to the initial address text are updated according to the prompt information. The prompt information includes the logistics waybill number of the dual address text, and the prompt information is sent to the terminal where the user is located, prompting the user to update the logistics resources such as the freight corresponding to the initial address text according to the prompt information, thereby improving the reasonable allocation of logistics resources.
[0115] In the above dual-address text recognition method, the initial address text of the obtained logistics waybill is segmented and split to obtain the split words of the initial address text, that is, the first segmentation set. According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-constructed address vocabulary, and the first target segmentation corresponding to each target regional level is determined from the first segmentation set; the initial address text is segmented according to each first target segmentation to obtain a segmented address text; the segmented address text is segmented and split to obtain a second segmentation set; the second segmentation set is matched with a pre-constructed address vocabulary, and when the matched second target is different from the first target segmentation, the segmented address text is processed by regular filtering to eliminate the interference of other segmentations on the target regional level segmentation, thereby improving the accuracy of address text recognition; the logistics resources are updated according to the generated prompt information, thereby improving the reasonable allocation of logistics resources.
[0116] In one embodiment, Figure 5 As shown, a dual address text recognition step is provided, which is applied to Figure 1 The following is an example of the terminal in Figure 1.
[0117] Step 502: construct an address vocabulary.
[0118] Specifically, the historical address text and basic address vocabulary of the logistics waybill within a preset time period are obtained; the target word segmentation corresponding to each target geographical level is obtained from the historical address text; according to each target word segmentation, the historical address text and the basic address vocabulary are fuzzy matched to obtain a matching result; according to the matching result, the basic address vocabulary is updated to obtain an address vocabulary.
[0119] Step 504, obtain the initial address text of the logistics waybill.
[0120] Step 506: split the initial address text to obtain a first segmented word set, and match the first segmented word set with the address word library to obtain a first target segmented word.
[0121] Step 508: perform address segmentation on the initial address text to obtain segmented address text.
[0122] Step 510, split the segmented address text to obtain a second segmented word set, match the second segmented word set with the address word library, and determine whether there is a second target segmented word. If so, execute step 514, otherwise execute step 512.
[0123] Step 512, determine whether the first target word segmentation is the same as the second target word segmentation, if so, execute step 514; otherwise, execute step 516.
[0124] Step 514, displaying the initial address text as normal data.
[0125] Step 516, performing regular filtering processing on the segmented address text to obtain processed address text.
[0126] Step 518: perform word segmentation on the processed address text to obtain a third word segmentation set.
[0127] Specifically, when the first target segmented word and the second target segmented word are different, regular filtering is performed on the segmented address text to obtain a processed address text; and segmentation is performed on the processed address text to obtain a third segmented word set.
[0128] Step 520, matching the third segmented word set with the pre-built address word library to obtain a third target segmented word, and when the first target segmented word and the third target segmented word are different, determining that the initial address text is a dual address text.
[0129] Specifically, according to the segmentation order of each segmentation in the third segmentation set, the third segmentation set is matched with a pre-constructed address vocabulary, and the third target segmentation corresponding to each target regional level is determined from the third segmentation set; when the first target segmentation and the third target segmentation are different, the initial address text is determined to be a dual address text.
[0130] In the above-mentioned dual-address text recognition step, by pre-building an address vocabulary, the initial address text of the acquired logistics order is segmented and split to obtain a first segmentation set. According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with the pre-built address vocabulary, and the first target segmentation corresponding to each target regional level is determined from the first segmentation set; the initial address text is segmented according to each first target segmentation to obtain a segmented address text; the segmented address text is segmented to obtain a second segmentation set; the second segmentation set is matched with the pre-built address vocabulary, and when the matched second target is different from the first target segmentation, the segmented address text is processed by regular filtering to eliminate the interference of other segmentations on the target regional level segmentation, thereby improving the accuracy of address text recognition; the logistics resources are updated according to the generated prompt information, thereby improving the reasonable allocation of logistics resources.
[0131] It should be understood that although Figure 2-5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-5 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0132] In one embodiment, Figure 6 As shown, a dual-address text recognition device is provided, including: an acquisition module 602, a first splitting module 604, a matching module 606, a segmentation module 608, a second splitting module 610, a detection module 612 and a determination module 614, wherein:
[0133] The acquisition module 602 is used to acquire the initial address text of the logistics waybill.
[0134] The first splitting module 604 is used to perform word segmentation on the obtained initial address text of the logistics waybill to obtain a first word segmentation set.
[0135] The matching module 606 is used to match the first segmented word set with a pre-built address word library according to the segmentation order of each segmented word in the first segmented word set, and determine the target segmented word corresponding to the target regional level from the first segmented word set.
[0136] The segmentation module 608 is used to perform address segmentation on the initial address text according to the first target segmentation word to obtain segmented address text.
[0137] The second splitting module 610 is used to perform word segmentation on the segmented address text to obtain a second word segmentation set.
[0138] The detection module 612 is used to match the second segmented word set with the pre-built address word library according to the segmentation order of each segmented word in the second segmented word set, and detect whether the target segmented word exists in the segmented address text.
[0139] The determination module 614 is used to determine that the initial address text is a dual address text when the target segmentation word exists in the segmented address text.
[0140] In the above-mentioned dual-address text recognition device, the initial address text of the obtained logistics waybill is segmented and split to obtain the split words of the initial address text, that is, the first segmentation set. According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-constructed address vocabulary, and the first target segmentation corresponding to each target geographical level is determined from the first segmentation set; the initial address text is segmented according to each first target segmentation to obtain a segmented address text; the segmented address text is segmented and split to obtain a second segmentation set; the second segmentation set is matched with the pre-constructed address vocabulary, and when the matched second target is different from the first target segmentation, the initial address text is determined to be a dual-address text; that is, by pre-constructing an address vocabulary, the address text of the logistics waybill is split twice, the first segmentation set and the second segmentation set are matched with the address vocabulary to obtain the first target segmentation and the second target segmentation, and the dual address text is determined by detecting whether the first target segmentation is the same as the second target segmentation, thereby improving the accuracy of address text recognition.
[0141] In another embodiment, Figure 7 As shown, a dual-address text recognition device is provided, which includes, in addition to an acquisition module 602, a first splitting module 604, a matching module 606, a segmentation module 608, a second splitting module 610, a detection module 612 and a determination module 614, a regular filtering processing module 616, a third splitting module 618, a conversion module 620, an update module 622 and a prompt module 624, wherein:
[0142] The regular expression filtering processing module 616 is used to perform regular expression filtering processing on the segmented address text to obtain a processed address text when the first target segmentation word and the second target segmentation word are different.
[0143] The third splitting module 618 is used to perform word segmentation on the processed address text to obtain a third word segmentation set.
[0144] The matching module 606 is further configured to match the third segmented word set with a pre-built address vocabulary according to the segmentation order of each segmented word in the third segmented word set, and determine the third target segmented word corresponding to each target regional level from the third segmented word set.
[0145] The determination module 614 is further configured to determine that the initial address text is a dual-address text when the first target segmentation word and the third target segmentation word are different.
[0146] The conversion module 620 is used to detect the initial address text. When the font of the initial address text is not the target font, the font of the address text is converted to the target font or the address text is deleted from the initial address text to obtain a recognizable initial address text.
[0147] The acquisition module 602 is further used to acquire the priority and word limit of each target regional level.
[0148] The matching module 606 is also used to match the first segmentation set with a pre-built address vocabulary based on the priority levels and the segmentation number limit according to the segmentation order of each segmentation in the first segmentation set, and determine the first target segmentation corresponding to each target regional level from the first segmentation set.
[0149] The determination module 614 is further configured to determine segmentation points of the initial address text according to each first target segmentation word.
[0150] The segmentation module 608 is further configured to perform address segmentation on the initial address text based on the segmentation point to obtain segmented address text.
[0151] The acquisition module 602 is also used to acquire the historical address text and basic address vocabulary of the logistics waybill within a preset time period; and acquire the target segmentation corresponding to each target regional level from the historical address text.
[0152] The matching module 606 is also used to perform fuzzy matching on the historical address text and the basic address word library according to each target word segmentation to obtain a matching result.
[0153] The updating module 622 is used to update the basic address word library according to the matching result to obtain the address word library.
[0154] The prompt module 624 is used to generate prompt information of the initial address text.
[0155] The updating module 622 is also used to update the logistics resources corresponding to the initial address text according to the prompt information.
[0156] In one embodiment, the initial address text of the acquired logistics waybill is segmented and split to obtain the split words of the initial address text, i.e., a first segmentation set. The first segmentation set is matched with a pre-constructed address vocabulary according to the segmentation order of each segmentation in the first segmentation set, and the first target segmentation corresponding to each target regional level is determined from the first segmentation set; the initial address text is segmented according to each first target segmentation to obtain a segmented address text; the segmented address text is segmented and split to obtain a second segmentation set; the second segmentation set is matched with a pre-constructed address vocabulary, and when the matched second target is different from the first target segmentation, the segmented address text is processed by regular filtering to eliminate the interference of other segmentations on the target regional level segmentation, thereby improving the accuracy of address text recognition; the logistics resources are updated according to the generated prompt information, thereby improving the reasonable allocation of logistics resources.
[0157] For the specific definition of the dual-address text recognition device, please refer to the definition of the dual-address text recognition method above, which will not be repeated here. Each module in the above dual-address text recognition device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0158] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a dual-address text recognition method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0159] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0160] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0161] Get the initial address text of the logistics waybill;
[0162] Perform word segmentation on the initial address text of the obtained logistics waybill to obtain a first word segmentation set;
[0163] According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-built address vocabulary, and the first target segmentation corresponding to each target regional level is determined from the first segmentation set;
[0164] Performing address segmentation on the initial address text according to each first target segmentation word to obtain segmented address text;
[0165] Perform word segmentation on the segmented address text to obtain a second word segmentation set;
[0166] According to the segmentation order of each segmentation in the second segmentation set, the second segmentation set is matched with a pre-built address vocabulary, and the second target segmentation corresponding to each target regional level is determined from the second segmentation set;
[0167] When the first target segmented word and the second target segmented word are different, it is determined that the initial address text is a double address text.
[0168] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0169] When the first target segmentation word and the second target segmentation word are different, regular filtering is performed on the segmented address text to obtain a processed address text;
[0170] Perform word segmentation on the processed address text to obtain a third word segmentation set;
[0171] According to the segmentation order of each segmentation in the third segmentation set, the third segmentation set is matched with a pre-built address vocabulary, and the third target segmentation corresponding to each target regional level is determined from the third segmentation set;
[0172] When the first target segmented word and the third target segmented word are different, it is determined that the initial address text is a double address text.
[0173] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0174] The initial address text is detected. When the font of the initial address text is not the target font, the font of the address text is converted to the target font or the address text is deleted from the initial address text to obtain the recognizable initial address text.
[0175] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0176] Obtain the priority and word limit of each target region level;
[0177] Based on the priorities and the word count limit, the first word set is matched with a pre-built address word library according to the word order of each word in the first word set, and the first target word corresponding to each target regional level is determined from the first word set.
[0178] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0179] Determine the segmentation point of the initial address text according to each first target segmentation word;
[0180] Based on the segmentation point, the initial address text is segmented to obtain segmented address text.
[0181] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0182] Obtain the historical address text and basic address vocabulary of logistics waybills within a preset time period;
[0183] Obtain target segmentations corresponding to each target regional level from the historical address text;
[0184] According to each target word segmentation, fuzzy matching is performed on the historical address text and the basic address word library to obtain the matching result;
[0185] The basic address word library is updated according to the matching results to obtain an address word library.
[0186] In one embodiment, when the processor executes the computer program, the following steps are also implemented:
[0187] Generate prompt information for the initial address text;
[0188] According to the prompt information, update the logistics resources corresponding to the initial address text.
[0189] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0190] Get the initial address text of the logistics waybill;
[0191] Perform word segmentation on the initial address text of the obtained logistics waybill to obtain a first word segmentation set;
[0192] According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-built address vocabulary, and the first target segmentation corresponding to each target regional level is determined from the first segmentation set;
[0193] Performing address segmentation on the initial address text according to each first target segmentation word to obtain segmented address text;
[0194] Perform word segmentation on the segmented address text to obtain a second word segmentation set;
[0195] According to the segmentation order of each segmentation in the second segmentation set, the second segmentation set is matched with a pre-built address vocabulary, and the second target segmentation corresponding to each target regional level is determined from the second segmentation set;
[0196] When the first target segmented word and the second target segmented word are different, it is determined that the initial address text is a double address text.
[0197] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0198] When the first target segmentation word and the second target segmentation word are different, regular filtering is performed on the segmented address text to obtain a processed address text;
[0199] Perform word segmentation on the processed address text to obtain a third word segmentation set;
[0200] According to the segmentation order of each segmentation in the third segmentation set, the third segmentation set is matched with a pre-built address vocabulary, and the third target segmentation corresponding to each target regional level is determined from the third segmentation set;
[0201] When the first target segmented word and the third target segmented word are different, it is determined that the initial address text is a double address text.
[0202] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0203] The initial address text is detected. When the font of the initial address text is not the target font, the font of the address text is converted to the target font or the address text is deleted from the initial address text to obtain the recognizable initial address text.
[0204] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0205] Obtain the priority and word limit of each target region level;
[0206] Based on the priorities and the word count limit, the first word set is matched with a pre-built address word library according to the word order of each word in the first word set, and the first target word corresponding to each target regional level is determined from the first word set.
[0207] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0208] Determine the segmentation point of the initial address text according to each first target segmentation word;
[0209] Based on the segmentation point, the initial address text is segmented to obtain segmented address text.
[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0211] Obtain the historical address text and basic address vocabulary of logistics waybills within a preset time period;
[0212] Obtain target segmentations corresponding to each target regional level from the historical address text;
[0213] According to each target word segmentation, fuzzy matching is performed on the historical address text and the basic address word library to obtain the matching result;
[0214] The basic address word library is updated according to the matching results to obtain an address word library.
[0215] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0216] Generate prompt information for the initial address text;
[0217] According to the prompt information, update the logistics resources corresponding to the initial address text.
[0218] Those of ordinary skill in the art can understand 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 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 this 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).
[0219] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0220] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A dual-address text recognition method, characterized in that: The method comprises: Get the initial address text of the logistics waybill; Perform word segmentation on the initial address text of the obtained logistics waybill to obtain a first word segmentation set; According to the segmentation order of each segmentation in the first segmentation set, the first segmentation set is matched with a pre-built address vocabulary, and a first target segmentation corresponding to each target regional level is determined from the first segmentation set; Performing address segmentation on the initial address text according to each of the first target segmentation words to obtain segmented address text; Performing word segmentation on the segmented address text to obtain a second word segmentation set; According to the segmentation order of each segmentation in the second segmentation set, the second segmentation set is matched with a pre-built address vocabulary, and a second target segmentation corresponding to each target regional level is determined from the second segmentation set; When the first target segmented word and the second target segmented word are different, it is determined that the initial address text is a dual address text.
2. The method according to claim 1, characterized in that When the first target segmentation word and the second target segmentation word are different, determining that the initial address text is a dual address text includes: When the first target segmented word and the second target segmented word are different, performing regular filtering processing on the segmented address text to obtain a processed address text; Performing word segmentation on the processed address text to obtain a third word segmentation set; According to the segmentation order of each segmentation in the third segmentation set, the third segmentation set is matched with a pre-constructed address vocabulary, and a third target segmentation corresponding to each target regional level is determined from the third segmentation set; When the first target segmented word and the third target segmented word are different, it is determined that the initial address text is a dual address text.
3. The method according to claim 1, characterized in that Before performing word segmentation on the acquired initial address text of the logistics waybill to obtain the first word segmentation set, the method further includes: The initial address text is detected, and when the font of the address text in the initial address text is not the target font, the font of the address text is converted to the target font or the address text is deleted from the initial address text to obtain a recognizable initial address text.
4. The method according to claim 1, characterized in that: The step of matching the first segmented word set with a pre-built address word library according to the segmented order of each segmented word in the first segmented word set, and determining the first target segmented word corresponding to each target regional level from the first segmented word set includes: Obtaining the priority and word limit of each target regional level; Based on the priorities and the word count limit, the first word set is matched with a pre-built address vocabulary according to the word order of each word in the first word set, and the first target word corresponding to each target regional level is determined from the first word set.
5. The method according to claim 1, characterized in that The performing address segmentation on the initial address text according to each of the first target segmentation words to obtain segmented address text includes: Determining the segmentation points of the initial address text according to each of the first target segmented words; Based on the segmentation point, the initial address text is segmented to obtain segmented address text.
6. The method according to claim 1, characterized in that The method for constructing the address vocabulary includes: Obtain the historical address text and basic address vocabulary of logistics waybills within a preset time period; Acquire target segmentations corresponding to each target regional level from the historical address text; According to each of the target segmented words, fuzzy matching is performed on the historical address text and the basic address word library to obtain a matching result; The basic address word library is updated according to the matching result to obtain an address word library.
7. The method according to any one of claims 1 or 2, characterized in that: The method further comprises: Generate prompt information of the initial address text; According to the prompt information, the logistics resources corresponding to the initial address text are updated.
8. A dual-address text recognition device, characterized in that: The device comprises: The acquisition module is used to obtain the initial address text of the logistics waybill; The first splitting module is used to split the initial address text of the obtained logistics waybill into words to obtain a first word set; a matching module, configured to match the first segmented word set with a pre-built address word library according to the segmentation order of each segmented word in the first segmented word set, and determine a first target segmented word corresponding to each target regional level from the first segmented word set; A segmentation module, configured to perform address segmentation on the initial address text according to each of the first target segmentation words to obtain segmented address text; A second splitting module is used to split the segmented address text into words to obtain a second word set; a detection module, configured to match the second segmented word set with a pre-built address word library according to the segmentation order of each segmented word in the second segmented word set, and determine the second target segmented word corresponding to each target regional level from the second segmented word set; A determination module is used to determine that the initial address text is a dual address text when the first target segmentation word and the second target segmentation word are different.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to 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 according to any one of claims 1 to 7 are implemented.
