Address identification method, terminal device and storage medium
By integrating an address recognition model and dictionary into the terminal device, local address recognition and result merging are achieved, solving the privacy leakage problem in the terminal device address recognition process and improving security and accuracy.
Patent Information
- Application Number
- CN202310588441.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2024-11-22
AI Technical Summary
Sending address text to cloud-side devices during address recognition on terminal devices poses a risk of privacy breaches and could lead to the leakage of user information.
Implement an address recognition model and dictionary in the terminal device. By recognizing address text locally and combining the address recognition results with the matching results, the target address is determined, thus avoiding sending data to the cloud.
It improves the security and accuracy of address recognition, prevents the leakage of user information, and reduces the computing power consumption of terminal devices.
Smart Images

Figure CN119005188A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminals, and in particular to an address identification method, a terminal device and a storage medium. Background Art
[0002] With the continuous development of artificial intelligence (AI) and big data, entity recognition has become one of the important technologies. Entity recognition includes multiple recognition scenarios, such as address recognition scenario, name recognition scenario, and document recognition scenario. In the address recognition scenario, it is necessary to perform address recognition on the address text to be recognized. When the terminal device performs address recognition on the address text to be recognized, the terminal device usually needs to send the address text to be recognized to the cloud side device for address recognition, so as to obtain the recognized target address.
[0003] However, there is a risk of data leakage when sent to cloud-side devices, which may lead to privacy leakage of terminal device users. Summary of the invention
[0004] The embodiments of the present application disclose an address recognition method, a terminal device, and a storage medium, which can avoid the privacy leakage of the address text to be recognized during the address recognition process and improve the security of address recognition.
[0005] The first aspect of the present application discloses an address recognition method, which is applied to a terminal device. The method includes: based on a preset address recognition model, performing address recognition on an address text to be recognized to obtain an address recognition result; based on a vocabulary pre-stored in the terminal device, performing address matching on the address text to obtain an address matching result; and merging the address recognition result with the address matching result to obtain a target address.
[0006] The above method can complete the address recognition of the address text to be recognized based on the terminal device, without sending the address text to be recognized to the cloud side for recognition, which can ensure that the user's information will not flow out, avoid the user's information being leaked, and thus improve the security of address recognition; at the same time, the address recognition result obtained based on the address recognition model in the terminal device and the address matching result obtained based on the vocabulary can jointly determine the target address corresponding to the address text. The address matching result obtained based on the vocabulary can be used to verify the recognition result of the address recognition model, avoiding the situation where the address recognition model of the terminal device is small, resulting in a long-tail problem in the recognition result of the model, thereby improving the accuracy of address recognition.
[0007] In some optional implementations, the merging of the address recognition result with the address matching result to obtain the target address includes: determining the subscript of the address recognition result based on the position of the address recognition result in the address text, and determining the subscript of the address matching result based on the position of the address matching result in the address text; merging the address recognition result with the address matching result in the order of the subscripts based on the subscripts of the address recognition result and the subscript of the address matching result to obtain the target address. The above method can realize the merging of the address recognition result and the address matching result to obtain the merged address.
[0008] In some optional implementations, the step of merging the address recognition result with the address matching result to obtain the target address includes: if it is determined that there is a conflict between the address recognition result and the address matching result, determining a non-conflicting entity in the address recognition result; and merging the non-conflicting entity with the address matching result to obtain the target address. The above method can avoid the situation where the address recognition result and the address matching result are directly merged based on the subscript order when there is a conflict between the address recognition result and the address matching result, resulting in an error in the merged target address, thereby improving the accuracy of address recognition.
[0009] In some optional implementations, the word library includes a global library and a regional library, the global library is used to store multiple points of interest names in the target country, and the regional library is used to store multiple points of interest names in the target city. The above method can store the names of points of interest in different well-known ranges separately, which facilitates the management of the word library.
[0010] In some optional implementations, the method further includes: when it is detected that the system of the terminal device is updated, updating the global library of the terminal device according to the global library in the cloud-side device. The above method can update the terminal device when the terminal device system is updated.
[0011] In some optional implementations, the method further includes: when it is detected that the city where the terminal device is located switches, the regional library is updated so that the updated regional library includes the high-frequency full name, high-frequency abbreviation and low-frequency full name of the region corresponding to the city where the terminal device is currently located. The above method can ensure the timeliness of the update of the regional library, and ensure that after each city switch, the terminal device's vocabulary can store the high-frequency full name, high-frequency abbreviation and low-frequency full name of the region corresponding to the city where the terminal device is currently located, so as to ensure that more accurate address matching results can be matched as much as possible during matching.
[0012] In some optional implementations, the method further includes: determining the high-frequency stay cities of the terminal device in the current analysis cycle according to a preset analysis cycle and a high-frequency duration threshold, and updating the regional library according to the determined high-frequency stay cities. The above method can determine the high-frequency stay cities corresponding to the terminal device in each analysis cycle according to the preset analysis cycle and the high-frequency duration threshold, and update the regional library of the address matching module based on the determined high-frequency stay cities, so as to ensure that the names of the points of interest stored in the regional library of the address matching module are highly relevant to the life of the terminal device user, thereby making the matched address matching results more accurate, thereby improving the accuracy of text recognition.
[0013] In some optional implementations, after determining the high-frequency stay cities of the terminal device in the current analysis cycle, the method further includes: deleting the high-frequency full names, high-frequency abbreviations, and low-frequency full names of the regions corresponding to the high-frequency stay cities in the previous analysis cycle in the region library. The above method can avoid storing too many full names of regions in the region library of the address matching module, and reduce the memory usage of the address library on the terminal device.
[0014] In some optional implementations, the method further includes: when it is detected that the city where the terminal device is located switches, determining the target historical city corresponding to the terminal device among all the cities where the terminal device has historically stayed according to a preset target number; and updating the regional library based on the determined target historical city. The above method can control the number of address words stored in the terminal device, and can avoid as much as possible the regional library in the terminal device from storing too many high-frequency full names, high-frequency abbreviations, and low-frequency full names of cities, which will occupy too much memory in the terminal device and even affect the running speed of the terminal device.
[0015] In some optional implementations, the word library includes a standard address library, the standard address library is used to store hierarchical address words, the standard address library corresponds to the standard address library of the cloud side device, and the method further includes: updating the standard address library of the word library according to the standard address library updated by the cloud side device. The above method can update the standard address library in a timely manner, thereby improving the accuracy of the matched address matching results.
[0016] In some optional implementations, before address recognition is performed on the address text to be recognized based on the preset address recognition model, the method further includes: obtaining training data annotated by the cloud-side device from the cloud-side device; and training the address recognition model based on the acquired training data. The above method can be based on annotating the training data on the cloud-side device without using the terminal device for annotation, thereby reducing the computing power consumption of the terminal device.
[0017] A second aspect of the present application discloses a computer-readable storage medium, comprising computer instructions. When the computer instructions are executed on a terminal device, the terminal device executes the address recognition method as described in the first aspect.
[0018] The third aspect of the present application discloses a terminal device, which includes a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the terminal device executes the address identification method described in the first aspect.
[0019] It should be understood that the computer-readable storage medium described in the second aspect and the terminal device described in the third aspect both correspond to the method of the first aspect. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a service recommendation method provided in an embodiment of the present application.
[0021] Figure 2 A scenario diagram of a service recommendation method provided in an embodiment of the present application.
[0022] Figure 3 A flowchart of an address identification method provided in an embodiment of the present application.
[0023] Figure 4 A schematic diagram of a scenario for updating an address matching module library provided in an embodiment of the present application.
[0024] Figure 5 A schematic diagram of a scenario of a result merging method provided in an embodiment of the present application.
[0025] Figure 6 A flowchart of a result merging method provided in an embodiment of the present application.
[0026] Figure 7 A scenario diagram of a method for merging address recognition results and address matching results provided in an embodiment of the present application.
[0027] Figure 8 A scenario diagram of a method for merging non-conflicting entity and address matching results provided in an embodiment of the present application.
[0028] Fig. 9 A flowchart of a method for obtaining an address recognition result based on an address text provided in an embodiment of the present application.
[0029] Fig.10A schematic diagram of a scenario of a method for performing address recognition on address text using an address recognition model provided in an embodiment of the present application.
[0030] Fig.11 A flowchart of a cloud-side data labeling method provided in an embodiment of the present application.
[0031] Fig.12 A schematic diagram of the framework of a terminal device provided in an embodiment of the present application.
[0032] Fig.13 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, words such as "exemplary", "or", "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "or", "for example" is intended to present related concepts in a concrete way.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application. The terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It should be understood that, unless otherwise specified in the present application, " / " means or. For example, A / B can represent A or B. "And / or" in the present application is only a kind of association relationship describing associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. "At least one" means one or more. "Multiple" means two or more than two. For example, at least one of a, b or c can represent: a, b, c, a and b, a and c, b and c, a, b and c seven situations. It should be understood that the order of the steps shown in the flowchart of this article can be changed, and some can also be omitted.
[0035] An entity (also called a named entity) can be understood as a collection of certain things or objects. Among them, a certain kind of thing or object can be a specific person, thing, or object, or it can be an abstract concept, such as a collection of names, place names, organization names, quantities, dates, times, proper nouns, etc. For example, a certain kind of object is Zhang San and Li Si. It can be considered that Zhang San and Li Si belong to the collection of names, and the names can be regarded as an entity. For another example, a certain kind of thing is Shijiazhuang, Shenzhen, and Beijing. It can be considered that Shijiazhuang, Shenzhen, and Beijing belong to the collection of place names, and the place names can be regarded as an entity.
[0036] Entity recognition is a basic task in Natural Language Processing (NLP). Entity recognition refers to the process of identifying instances corresponding to a specified entity from the text to be processed. Instances may have multiple forms in the text, usually words or short sentences. Entity recognition includes multiple recognition scenarios, such as address recognition scenario, name recognition scenario, and document recognition scenario.
[0037] In the address recognition scenario, when the terminal device performs address recognition on the address text to be recognized, the terminal device usually needs to send the address text to be recognized to the cloud-side device for address recognition, so as to obtain the recognized target address. The address text is the text that needs to be recognized. However, the data sent to the cloud-side device has the risk of privacy leakage, which may cause the privacy leakage of the terminal device user. For example, a privacy attacker can obtain the information of the terminal device user by obtaining the data sent by the terminal device to the cloud-side device, thereby causing the privacy leakage of the terminal device user.
[0038] In order to avoid leakage of terminal device user information during the address recognition process and improve the security of address recognition, an embodiment of the present application provides an address recognition method, which is applied to a terminal device. The terminal device includes an address recognition model. Based on the address recognition model, address recognition of an address text to be recognized can be completed on the terminal device without sending the address text to be recognized to a cloud-side device for recognition. This ensures that user information will not be leaked, avoids leakage of user information, and improves the security of address recognition.
[0039] The address recognition method provided in the embodiment of the present application is applied to a terminal device. For example, the terminal device in the embodiment of the present application may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an in-vehicle device, an ultra-mobile personal computer (UMPC), a smart watch, or other terminal devices. The embodiment of the present application does not impose any special restrictions on the specific form of the terminal device. An operating system is installed on the terminal device, and the operating system may be Windows system, System and One system in the system or other systems not shown.
[0040] In the embodiments of the present application, cloud-side devices refer to one or more computing devices deployed on a cloud environment, or one or more computing devices in an edge environment. For example, cloud-side devices may include cloud servers, central servers, and the like. Taking a cloud server as an example, a cloud server refers to a cluster of central computing devices used to provide computing, storage, and communication resources. A cloud server is a type of server with the characteristics of being highly distributed and highly virtualized. Its computing resources are obtained by scheduling from a large number of integrated virtualized physical servers. From the perspective of node scale, such a virtualization scale may be a few, dozens, or hundreds of physical servers, or it may be a large cloud virtual resource pool built from thousands of physical hardware across data centers.
[0041] The address recognition method provided in the embodiment of the present application will be described below by way of example with reference to the accompanying drawings.
[0042] Figure 1 A flow chart of a service recommendation method provided in an embodiment of the present application. Figure 1 As shown, the terminal device includes a gallery, an optical character recognition (OCR) module, a clipboard, a decision-making platform, service recommendations, and a natural language understanding service (NLUService). The decision-making platform can be used to obtain the address text to be recognized. For example, the OCR module can obtain the address text to be recognized from the image by recognizing the image; the decision-making platform can obtain the address text to be recognized from the OCR module by interacting with the OCR module; the decision-making platform can also obtain the address text to be recognized copied from the clipboard by interacting with the clipboard.
[0043] The address text is the text that needs to be recognized. In one embodiment of the present application, the address text may not contain address elements related to the address, such as the target address. After the decision-making center obtains the address text to be recognized, it can recognize the address text to be recognized by calling the natural language understanding service to identify the target address. Figure 1As shown, the natural language understanding service includes a text acquisition module, an address recognition model, an address matching module, and a result fusion module. The text acquisition module is used to obtain the address text to be recognized. After the text acquisition module receives the address text to be recognized, it can recognize the address text through the address recognition model to obtain the address recognition result, and match the address text through the address matching module to obtain the address matching result. Finally, based on the result fusion module, the address recognition result and the address matching result are fused to obtain the target address, and the obtained target address is returned to the decision-making center.
[0044] The service recommendation method provided in the above embodiment can complete address recognition of the address text to be recognized based on the natural language service of the terminal device. There is no need to send the address text to be recognized to the cloud side device for recognition. It can ensure that the user's information will not leak out, avoid the user's information being leaked, and improve the security of address recognition.
[0045] In one embodiment of the present application, the terminal device also includes a service recommendation, which is used to recommend services to users. After the decision-making center receives the returned target address, it can send the target address to the service recommendation. The service recommendation can recommend related services to the user based on the received target address, such as map navigation service, one-click taxi service, driving navigation service, and collection service. The service type recommended by the service recommendation according to the target recommendation can be set according to the user's needs, and no limitation is made here.
[0046] Figure 2 A schematic diagram of a scenario of a service recommendation method provided in an embodiment of the present application. Figure 2 As shown in (a), the user can copy the received information through the clipboard to obtain the address text to be recognized. The terminal device performs address recognition on the address text to be recognized, and after obtaining the target address, the terminal device will recommend corresponding services to the user based on the determined target address, such as Figure 2 As shown in (b), map navigation, one-click taxi, driving navigation and other services are recommended to the user. In one embodiment of the present application, the current location of the terminal device can be set as the starting point corresponding to the service, and the location shown by the target address can be set as the destination corresponding to the service. For example, the current location of the terminal device can be set as the starting point corresponding to the map navigation service, and the location shown by the target address can be set as the destination in the map navigation service. When the terminal device performs address recognition on the address text to be recognized and fails to obtain the target address, no service recommendation will be generated.
[0047] Figure 3 A flowchart of an address identification method provided in an embodiment of the present application. Figure 3 Can be used for Figure 1The process of address recognition by the natural language understanding service in the flowchart is illustrated by way of example. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0048] 301. A text acquisition module receives address text to be recognized.
[0049] In one embodiment of the present application, the text acquisition module may be a module in the NPL service built into the terminal device system, which is used to obtain the address text to be identified. The address text is the text that needs to be identified, and the address text may include one or more address elements. In one embodiment of the present application, the address elements may include but are not limited to: province, city, district, township street, village, road, house number, point of interest (POI for short), building, room number, express station, express cabinet name and other information.
[0050] POI is a term in geographic information system, which refers to all geographic objects that can be abstracted as points. POI can include point data of landmark buildings and geographic entities that are closely related to people's lives, and can reflect various activities in the city to a certain extent. POI can be used to describe the address of things or events, which can greatly enhance the description and query capabilities of the location of things or events, and improve the accuracy and speed of geographic positioning. Each POI generally contains at least four aspects of information: name, category, longitude and latitude, and address. POI can be used to mark the government departments represented by the place, commercial institutions of various industries (gas stations, department stores, supermarkets, restaurants, hotels, convenience stores, hospitals, etc.), public buildings (such as parks, museums, exhibition halls, public toilets, etc.), transportation facilities (various stations, parking lots, speed cameras, speed limit signs) and other places through a landmark or scenic spot in the geographic information system.
[0051] In one embodiment of the present application, the address text to be recognized may include text copied by the user to the clipboard, text obtained by performing OCR recognition on an image, or text obtained by performing text conversion on a voice. The method for obtaining the address text is not limited in any way in the embodiment of the present application.
[0052] 302. The text acquisition module sends the address text to the address recognition model.
[0053] In one embodiment of the present application, the address recognition model may be a trained model in the NPL service built into the terminal device system, and is used to recognize the address text to be recognized received by the text acquisition module. In one embodiment of the present application, the address recognition model may register a callback on the text acquisition module, and after obtaining the address text, the text acquisition module may send the address text to the address recognition model based on the callback.
[0054] 303. The text acquisition module sends the address text to the address matching module.
[0055] In one embodiment of the present application, the address matching module may be a module in the NPL service built into the terminal device system, and is used to match the address text to be identified received by the text acquisition module. In one embodiment of the present application, the address matching module may register a callback on the text acquisition module, and after obtaining the address text, the text acquisition module may send the address text to the address matching module based on the callback.
[0056] In the embodiment of the present application, there is no strict order between the above steps 302 and 303. Figure 3 The steps may be performed sequentially in the order shown in , or simultaneously, or sequentially in the order of step 303 and step 302, without any specific limitation here.
[0057] 304, the address recognition model obtains an address recognition result based on the address text.
[0058] The address recognition result is the address element recognized by the address recognition model in the address text. The address recognition result includes one or more address elements. The relevant description of the address elements can be found above. In the embodiment of the present application, the address element in the address recognition result is referred to as the first address element. For example, the address text is "Your YTO package has arrived. Please go to Jindiweixin, No. 25 Andemen Street, Nanjing City, Jiangsu Province to pick it up." The address recognition model recognizes the address text, and the address recognition result obtained includes: Jiangsu Province, Nanjing City, Andemen Street and No. 25, etc. Four first address elements. In one embodiment of the present application, Bilstm+CRF can be used as the model network structure of the address recognition model. For example, the address recognition model can be a small model that uses bidirectional LSTM+CRF as the model network structure. Bidirectional LSTM+CRF can ensure that the prediction delay will not be long when the model is small, thereby improving the speed of address recognition. Regarding the implementation method of the address recognition model based on the address text for address recognition, please refer to the relevant description below.
[0059] 305, the address recognition model sends the address recognition result to the result fusion module.
[0060] In one embodiment of the present application, the address recognition model may send the address recognition result to the result fusion module based on a callback.
[0061] 306. The address matching module obtains an address matching result based on the address text.
[0062] In an embodiment of the present application, a word library is provided in the terminal device for storing address words representing address elements. One address word can represent one address element. For example, the address words may include words such as Jiangsu Province, Nanjing City, Haidilao, etc. for representing address elements. The address matching module can perform full-text matching on the address text based on the address words stored in the terminal device to obtain an address matching result. The address matching result is the address word matched in the stored address words according to the address text. For example, the address text is "Your YTO package has arrived, please go to Jindi Weixin, No. 25 Andemen Street, Nanjing City, Jiangsu Province to pick it up", and the target address words matched by the address matching module in the stored address words are "Jiangsu Province", "Nanjing City", "Andemen Street" and "Jindi Weixin", and "Jiangsu Province", "Nanjing City", "Andemen Street" and "Jindi Weixin" are determined as address matching results.
[0063] In some embodiments of the present application, the address text and the stored address words can be matched by full-text search based on a prefix tree (Trie tree). Trie tree is a data structure that efficiently stores and searches for a set of strings, and can be used to process string matching data structures to solve the problem of quickly finding a string in a set of string sets. Trie tree can use the common prefixes between strings to merge repeated prefixes together. In one embodiment of the present application, a Trie tree can be constructed based on the stored address words. When performing full-text search matching, a search can be started from the root node in the Trie tree; the first letter of the keyword to be searched in the address text is obtained, and the corresponding subtree is selected based on the letter and the subtree is transferred to continue the search; on the corresponding subtree, the second letter of the keyword to be searched is obtained, and the corresponding subtree is further selected for search to determine whether the address text matches the address word in the stored address word.
[0064] Since each address word includes a corresponding address element, the address matching result may include one or more address elements. The relevant description of the address element can be found above. In the embodiment of the present application, the address element in the address matching result is referred to as the second address element. For example, the address text is "Your YTO package has arrived. Please go to Jindi Weixin, No. 25 Andemen Street, Nanjing City, Jiangsu Province to pick it up." The address matching module recognizes the address text, and the address matching result obtained includes four second address elements: Jiangsu Province, Nanjing City, Andemen Street, and Jindi Weixin.
[0065] In order to better store address words, in one embodiment of the present application, the terminal device can store different types of address words through different libraries. The word library in the terminal device may include a standard address library and a point of interest library. The standard address library is used to store hierarchical address words of four levels, such as first-level province, second-level city, third-level district, and fourth-level street, such as Guangdong Province, Shenzhen City, Longhua District, Longhua Street, etc. The point of interest library can be used to store POI names. In an embodiment of the present application, the point of interest library may include a global library and a regional library. The global library is used to store well-known point of interest names in a large range of areas, such as storing well-known point of interest names in the target country; the target country can be set according to the needs of the user. In one embodiment of the present application, the target country may include the country where the terminal device is located, which may be a country set by the user or a country that the user often visits. The regional library is used to store well-known address words in a small range of areas, such as well-known point of interest names in the target city. In one embodiment of the present application, the global library is a word library built into the terminal device when it leaves the factory, and the regional library is a word library generated based on the city fence after the terminal device is turned on. The city fence can be understood as a virtual fence that encloses a virtual geographical boundary, which is used to determine the city where the terminal device is currently located. When the terminal device enters, leaves a specific geographical city, or is active in the city, the terminal device can receive a notification triggered by the city fence to determine the current city. In one embodiment of the present application, after the terminal device is turned on for the first time, if the city where the terminal device is currently located is determined based on the city fence, a regional library is created, and the names of well-known points of interest in the city where the terminal device is currently located are stored in the created regional library. For example, when it is determined based on the city fence that the terminal device is currently located in Nanjing, a regional library is created, and the names of well-known points of interest in Nanjing are stored in the created regional library.
[0066] In order to better store the address words stored by the address matching module, in one embodiment of the present application, the global library can be further subdivided into a global high-frequency full name library and a global high-frequency abbreviation library. Among them, when the global library stores well-known address words in the country where the terminal device is currently located, the global high-frequency full name library can be used to store the full names of POIs with high frequency of occurrence and national popularity in the country where the terminal device is currently located (hereinafter referred to as "global high-frequency full names"). For example, when the country where the terminal device is currently located is China, the contents stored in the global high-frequency full name library may include global high-frequency full names such as Peking University, Tsinghua University, and the Palace Museum. When the global library stores well-known address words in the country where the terminal device is currently located, the global high-frequency abbreviation library can be used to store the abbreviations of POIs with high frequency of occurrence and national popularity in the country where the terminal device is currently located (hereinafter referred to as "global high-frequency abbreviations"). For example, when the country where the terminal device is currently located is China, the contents stored in the global high-frequency full name library may include global high-frequency abbreviations such as Renmin University, Peking University, and Home Inn.
[0067] In one embodiment of the present application, the regional library can be further subdivided into multiple word libraries, including: a regional high-frequency full name library, a regional high-frequency abbreviation library, and a regional low-frequency full name library. When the regional library stores well-known address words in the target city, the regional high-frequency full name library can be used to store the full names of POIs with high popularity in the target city (hereinafter referred to as "regional high-frequency full names"). For example, when the target city is Nanjing, the content stored in the regional high-frequency full name library can include regional high-frequency full names such as Ginkgo Lake Paradise and Xuanwu Lake. The regional high-frequency abbreviation library can be used to store POI abbreviations with high popularity in the target city (hereinafter referred to as "regional high-frequency abbreviations"). For example, when the target city is Beijing, the regional high-frequency abbreviation library can store high-frequency abbreviations such as Peking University Third Hospital and Renmin University Primary School. The regional low-frequency full name library can be used to store the full names of POIs with low popularity in the target city (hereinafter referred to as "regional low-frequency full names"). For example, when the target city is Nanjing, the content stored in the regional low-frequency full name library can include regional low-frequency full names such as Gemdale Weixin and Gongdeyuan. Because the regional high-frequency full name library, the regional high-frequency abbreviation library and the regional low-frequency full name library are all libraries in the regional library, they are equivalent to being referred to as regional libraries below and can be used to store regional high-frequency full names, regional high-frequency abbreviations and regional low-frequency full names.
[0068] In some embodiments of the present application, the region library in the address matching module includes the region high frequency full name, region high frequency abbreviation and region low frequency full name corresponding to the city where the terminal device is located. For example, when the city where the terminal device is located is Nanjing, the region library includes the region high frequency full name, region high frequency abbreviation and region low frequency full name corresponding to Nanjing.
[0069] In one embodiment of the present application, a word library corresponding to the standard address library and the point of interest library exists in the cloud side device corresponding to the terminal device. The standard address library and the point of interest library in the terminal device can be updated based on the word library corresponding to the cloud side device. Figure 4 A schematic diagram of a scenario for updating an address matching module library provided in an embodiment of the present application. Figure 4 As shown, the cloud-side device has a standard address library corresponding to the standard address library in the terminal device and a point of interest library corresponding to the point of interest library in the terminal device. Figure 4 As shown, when the standard address library of the cloud-side device is changed, the standard address library of the terminal device will be notified to be updated accordingly. In some embodiments of the present application, the cloud-side device can periodically obtain updated standard addresses from national official websites, such as the official website of the State Land Administration, to update the standard address library of the cloud-side device. In one embodiment of the present application, the global library of the terminal device will be updated as the terminal device system is updated. For example, when the terminal device system is updated, the global library of the terminal device can be updated according to the global library of the cloud-side device.
[0070] In one embodiment of the present application, the update time interval of the regional library in the terminal device can be pre-set, and the regional library in the terminal device can be controlled to be updated according to the update time interval. The update time interval can be set according to user needs, such as one day, one week, two weeks, etc. In one embodiment of the present application, when it is detected that the city where the terminal device is located is switched, the regional library in the terminal device can be updated, such as the regional library of the terminal device can be updated according to the city where the terminal device is currently located, so that the regional library of the address matching module includes the regional high-frequency full name, regional high-frequency abbreviation and regional low-frequency full name corresponding to the city where the terminal device is currently located. For example, when it is detected that the city where the terminal device is located is switched from Nanjing to Beijing, the regional library in the terminal device is updated so that the regional library in the terminal device contains the regional high-frequency full name, regional high-frequency abbreviation and regional low-frequency full name of Beijing. In one embodiment of the present application, it can be detected based on the city fence whether the city where the terminal device is located is switched. In one embodiment of the present application, the city fence will regularly report the city where the terminal device is currently located, and the reporting time can be set according to the needs of the user.
[0071] In an embodiment of the present application, when updating the vocabulary in the terminal device, the terminal device can update the vocabulary in the terminal device by acquiring corresponding data from the vocabulary of the cloud-side device. For example, when updating the standard address library in the regional matching module, the terminal device can update the standard address library in the regional matching module by acquiring corresponding data from the standard address library updated by the cloud-side device; similarly, the terminal device can update the global library and the regional library in the terminal device by acquiring corresponding data from the global library and the regional library of the cloud-side device. In another embodiment, when updating the vocabulary in the terminal device, the terminal device can update the vocabulary in the terminal device by acquiring part of the updated data from the vocabulary of the cloud-side device. In this embodiment, the terminal device does not need to acquire all data from the cloud-side device every time it is updated. It only needs to acquire the data updated by the cloud-side device during the time period corresponding to the time difference between the previous and next updates to update the vocabulary in the terminal device.
[0072] In one embodiment of the present application, the terminal device can update the regional library in the terminal device according to the regional library of the cloud side device at a fixed time. For example, the regional library in the terminal device stores the regional high-frequency full name, regional high-frequency abbreviation and regional low-frequency full name of a target city or multiple target cities. The terminal device can update the regional high-frequency full name, regional high-frequency abbreviation and regional low-frequency full name of the target city stored in the regional library of the terminal device according to the regional library of the cloud side device at a fixed time. The fixed time can be set according to the update requirements, for example, it can be set at a time when the terminal device may be idle, that is, the time when the user does not need to use the terminal device, such as 02:00 every day, 02:00 every Monday, 04:00 on the 1st of each month, and 04:00 on the 15th of each month. In some embodiments of the present application, the fixed time of the terminal device can be set based on the time when the cloud side device updates the regional library, so that the time interval between the fixed time of the terminal device and the update time of the cloud side device is small. For example, the update time of the cloud-side device is 02:00 every day, and the fixed time of the terminal device can be set to 02:05 every day; for another example, the update time of the cloud-side device is 02:00 every Monday, and the fixed time of the terminal device can be set to 02:05 every Monday.
[0073] In one embodiment of the present application, the region library in the terminal device may include the high-frequency full name of the region, the high-frequency abbreviation of the region, and the low-frequency full name of the region corresponding to the historical stay city of the terminal device. In order to avoid determining the region that the user occasionally passes through during the journey as the historical stay region of the terminal device, in some embodiments of the present application, the historical stay city is the region where the terminal device stays for a period of time exceeding the preset time threshold. The preset time threshold can be set according to user needs, such as 6 hours, 12 hours, 24 hours, etc. For example, the areas passed by the terminal device include: Nanchang and Jiujiang, and the preset time threshold is 6 hours; when the terminal device stays in Nanchang for 7 hours, it exceeds the preset time threshold, and it is determined that Nanchang is the historical stay city of the terminal device; when the terminal device stays in Jiujiang for 2 hours, it does not exceed the preset time threshold, and it is determined that Jiujiang is not the historical stay city of the terminal device.
[0074] In order to avoid the situation that the regional library in the terminal device stores too many regional high-frequency full names, regional high-frequency abbreviations and regional low-frequency full names of cities, which occupies too much memory in the terminal device and even affects the running speed of the terminal device, in one embodiment of the present application, the terminal device can manage the regional library in the terminal device so that the number of historical stay cities stored in the regional library is maintained at a preset target number. The preset target number can be set according to user needs, such as 3. When the preset target number is set to 3, the regional library in the terminal device includes the regional high-frequency full names, regional high-frequency abbreviations and regional low-frequency full names corresponding to the three cities where the terminal device has historically stayed. In one embodiment of the present application, when it is detected that the city where the terminal device is located is switched, according to the preset target number, the target historical stay city corresponding to the terminal device is determined among all the cities where the terminal device has historically stayed; and based on the determined target historical stay city, the regional library of the address matching module is updated so that the updated regional library includes the regional high-frequency full name, regional high-frequency abbreviation and regional low-frequency full name corresponding to the target historical stay city. The number of cities of the target historical stay city is the preset target number. The target historical stay cities to be stored in the regional library of the terminal device can be determined from among all the cities where the terminal device has historically stayed, in chronological order from the back to the front and in accordance with the preset target quantity. For example, when all the cities where the terminal device has historically stayed include Ningbo, Nanchang, Shenzhen, Shanghai, Beijing, and Tianjin, and the preset target quantity is 3, the three cities of Shanghai, Beijing, and Tianjin can be determined as the target historical stay cities in chronological order from the back to the front, and the regional library of the address matching module is updated according to the determined target historical cities, so that the updated regional library includes the high-frequency full names, high-frequency abbreviations, and low-frequency full names of the regions corresponding to the three cities of Shanghai, Beijing, and Tianjin.
[0075] In some embodiments of the present application, the regional library of the address matching module may include the regional high-frequency full name, regional high-frequency abbreviation, and regional low-frequency full name of the high-frequency stay city corresponding to the terminal device. The high-frequency stay area is one or more cities where the terminal device stays for a longer time within the preset analysis period. The preset analysis period can be set according to actual conditions, such as every three months, every six months, every year, etc. In some embodiments of the present application, a high-frequency duration threshold can be set. When the terminal device stays in a city for a period of time greater than the high-frequency duration threshold within the preset analysis period, it is determined that the city is a high-frequency stay city for the terminal device; when the terminal device stays in a city for a period of time equal to or less than the high-frequency duration threshold within the preset analysis period, it is determined that the city is not a high-frequency stay city for the terminal device. The high-frequency duration threshold can be set according to actual conditions, such as two weeks, one month, two months, etc.
[0076] In one embodiment of the present application, the terminal device determines the high-frequency stay cities of the terminal device in the current analysis cycle according to the preset analysis cycle and high-frequency duration threshold, and updates the regional library of the address matching module according to the high-frequency stay cities in the current analysis cycle, so that the updated regional library includes the regional high-frequency full name, regional high-frequency abbreviation and regional low-frequency full name corresponding to the high-frequency stay cities in the current analysis cycle. The above implementation method can determine the high-frequency stay cities corresponding to the terminal device in each analysis cycle according to the preset analysis cycle and high-frequency duration threshold, and update the regional library of the address matching module based on the determined high-frequency stay cities to ensure that the names of the points of interest stored in the regional library of the address matching module are strongly related to the life of the terminal device user, so that the matched address matching results are more accurate, thereby improving the accuracy of text recognition.
[0077] In one embodiment of the present application, after determining the high-frequency stay cities of the terminal device in the current analysis cycle, the high-frequency full name of the region, the high-frequency abbreviation of the region, and the low-frequency full name of the region corresponding to the high-frequency stay cities in the previous analysis cycle in the region library of the address matching module can be deleted. The above embodiment can avoid storing too many full names of regions in the region library of the address matching module, and reduce the memory usage of the address library on the terminal device.
[0078] 307. The address matching module sends the address matching result to the result fusion module.
[0079] In one embodiment of the present application, the address matching module may send the address matching result to the result fusion module based on the callback.
[0080] 308. The result fusion module obtains the target address based on the address recognition result and the address matching result.
[0081] In one embodiment of the present application, the result fusion module merges the address recognition result and the address matching result to obtain the target address. Based on the subscript of the address recognition result and the subscript of the address matching result, the address recognition result and the address matching result can be merged in the order of the subscripts to obtain the target address. The subscript refers to the position index of the characters in the address recognition result and the address matching result in the address text, which can be used to locate the position of the address recognition result and the address matching result in the address text. The subscript of the address recognition result can be determined based on the position of the address recognition result in the address text; the subscript of the address recognition result can be determined based on the position of the address recognition result in the address text. In one embodiment of the present application, the subscript of the first character in the address text can be 0, followed by 1, 2, 3, and so on. In other embodiments of the present application, the subscript of the first character in the address text can be set to 1, followed by 2, 3, 4, and so on.
[0082] Figure 5 A scenario diagram of a result merging method provided in an embodiment of the present application, for example, the address text is "Your YTO package has arrived, please go to Jindi Weixin, No. 25 Andemen Street, Nanjing, Jiangsu Province to pick it up", the subscript of the first character in the address text can be 0, such as Figure 5 As shown, the address recognition result has four first address elements: Jiangsu Province, Nanjing City, Andemen Street and No. 25, and the address matching result has four second address elements: Jiangsu Province, Nanjing City, Andemen Street and Gemdale Weixin. Figure 5 As shown, each character in each first address element (second address element) has its corresponding subscript. A first address element (second address element) can correspond to multiple subscripts. For example, the first address element (second address element) "Jiangsu Province" corresponds to three subscripts, among which "Jiang" is the 13th character in the address text, so the subscript of "Jiang" is 12; "Su" is the 14th character in the address text, so the subscript of "Su" is 13; "Province" is the 15th character in the address text, so the subscript of "Su" is 14. Figure 5 As shown, the address recognition result and the address matching result are merged in the order of the subscripts to obtain the target address "Golden Land Weixin, No. 25, Andemen Street, Nanjing, Jiangsu Province".
[0083] The address recognition method provided in the above embodiment can complete the address recognition of the address text to be recognized based on the terminal device, without sending the address text to be recognized to the cloud side for recognition, which can ensure that the user's information will not flow out, avoiding the user's information being leaked, thereby improving the security of address recognition; at the same time, the address recognition result obtained based on the address recognition model in the terminal device and the address matching result obtained based on the vocabulary are used to jointly determine the target address corresponding to the address text. The address matching result obtained based on the vocabulary can be used to verify the recognition result of the address recognition model, thereby avoiding the situation where the address recognition model of the terminal device is small, resulting in a long-tail problem in the recognition result of the model, thereby improving the accuracy of address recognition.
[0084] In order to avoid directly merging the address recognition result and the address matching result based on the subscript order when there is a conflict between the address recognition result and the address matching result, which may cause errors in the merged target address, an embodiment of the present application provides a result merging method. Figure 6 A flowchart of a result merging method provided in an embodiment of the present application can be applied to the result fusion module as a Figure 3 An implementation of step 308 in the flowchart. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0085] 601, determine whether there is a conflict between the address recognition result and the address matching result.
[0086] In one embodiment of the present application, it is possible to determine whether there is a conflict between the address recognition result and the address matching result by judging whether there is a first address element that is different from its corresponding second address element. When there is a first address element in the address recognition result that is different from its corresponding second address element, it is determined that there is a conflict between the address recognition result and the address matching result; when all first address elements in the address recognition result are different from their corresponding second address elements, it is determined that there is no conflict between the address recognition result and the address matching result. For example, the first address element is "Jindi", and the second address element corresponding to the first address element is "Jindi Weixin", "Jindi" and "Jindi Weixin" are different, and it is determined that there is a conflict between the address recognition result and the address matching result.
[0087] In one embodiment of the present application, the second address element corresponding to the first address element can be determined by the subscript. When a subscript in the first address element is the same as a subscript in the second address element, it is determined that there is a corresponding relationship between the first address element and the second address element, that is, it is determined that the first address element corresponds to the second address element; when all subscripts in the first address element are different from the subscripts of the second address element, it is determined that there is no second address element corresponding to the first address element. Figure 7 A schematic diagram of an address recognition result and an address matching result provided in an embodiment of the present application. Figure 7 As shown, the address recognition result has two first address elements: No. 25 and Jindi, and the address matching result has one second address element: Jindi Weixin. The first address element "Jindi" includes two characters and has two subscripts. The two subscripts of the first address element "Jindi" are the same as the two subscripts of the second address element "Jindi Weixin", which determines that there is a corresponding relationship between the first address element "Jindi" and the second address element "Jindi Weixin"; the first address element "No. 25" includes three characters and has three subscripts, and these three subscripts are different from the subscripts in the second address element, which determines that there is no corresponding second address element for the first address element "No. 25".
[0088] In one embodiment of the present application, when all first address element addresses in the address recognition result do not have corresponding second address elements, it is determined that there is no conflict between the address recognition result and the address matching result.
[0089] If it is determined that there is no conflict between the address recognition result and the address matching result, execute 602 to merge the address recognition result and the address matching result to obtain the target address. In one embodiment of the present application, the address recognition result and the address matching result can be merged based on the subscript of the address recognition result and the subscript of the address matching result in the order of the subscripts. For some specific implementations of step 602, please refer to the relevant description above.
[0090] If it is determined that there is a conflict between the address recognition result and the address matching result, execute 603 to determine a conflicting entity and a non-conflicting entity in the address recognition result according to the address recognition result and the address matching result.
[0091] The conflicting entity is a first address element that is different from its corresponding second address element. In the address recognition result, when a first address element is different from its corresponding second address element, the first address element is determined to be a conflicting entity. Figure 7 As shown, the second address element corresponding to the first address element "Jindi" is "Jindi Weixin", the first address element "Jindi" is different from the second address element "Jindi Weixin", and the first address element "Jindi" is determined as a conflicting entity.
[0092] A non-conflicting entity is a first address element that does not have a corresponding second address element, or a first address element that is the same as its corresponding second address element. In the address recognition result, when a first address element does not have a corresponding second address element, the first address element is determined as a non-conflicting entity. For example, Figure 7 As shown, the first address element "No. 25" does not have its corresponding second address element, and the first address element "No. 25" is determined as a non-conflicting entity. Alternatively, in the address recognition result, when a first address element is the same as its corresponding second address element, the first address element is determined as a non-conflicting entity. For example, the second address element corresponding to the first address element "Jiangsu Province" is "Jiangsu Province", and the first address element "Jiangsu Province" is the same as the second address element "Jiangsu Province", and the first address element "Jiangsu Province" is determined as a non-conflicting entity.
[0093] 604, merge the non-conflicting entities and the address matching results to obtain the target address.
[0094] In some embodiments of the present application, the conflicting entity in the address recognition result may be deleted, and the address recognition result with the conflicting entity deleted may be merged with the address matching result, thereby achieving the purpose of merging the non-conflicting entity and the address matching result. Figure 8 A scenario diagram of a method for merging non-conflicting entities and address matching results provided in an embodiment of the present application. For example, the address text is "Please go to the 25th Jindi Weixin Office to pick it up, please call 123456", such as Figure 8 As shown in (a), the address recognition result has two first address elements: No. 25 and Jindi, and the address matching result has a second address element: Jindi Weixin, where the first address element "No. 25" is a non-conflicting entity and the first address element "Jindi" is a conflicting entity. The first address element "Jindi" of the address recognition result is deleted. Figure 8 As shown in (b), the address recognition result after deleting the conflicting entities is merged with the address matching result.
[0095] Fig. 9 A flowchart of a method for obtaining an address recognition result based on an address text provided in an embodiment of the present application. Fig. 9 Can be used for Figure 3 The process of obtaining the address recognition result based on the address text in the self-address recognition model is illustrated as an example. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0096] 901, the address recognition model determines the word vector information of the address text based on the target vocabulary in the address text.
[0097] In one embodiment of the present application, the address recognition module may perform full-text matching of the address text with a preset vocabulary list to determine the target vocabulary in the address text; and based on the determined target vocabulary, determine the word vector information of the address text. The vocabulary list may include target vocabulary related to the address. The target vocabulary may include words representing hierarchical addresses and POI suffixes. Words representing hierarchical addresses may include: province, city, district, town, street, Guangdong, Shenzhen, Longhua, etc. The POI suffix may be a suffix in the POI name, which can be used to indicate the type of POI, such as a building, hotel, hospital, school, bank, etc. When a word in the address text is the same as a word in the vocabulary list, the word is determined to be the target vocabulary.
[0098] In one embodiment of the present application, after determining the vocabulary list, the word vector corresponding to each target word in the vocabulary list can be determined according to methods such as word2vec and GloVe that convert words into vectors. The word vector corresponding to the target vocabulary is used to determine the word vector information of the address text. In one embodiment of the present application, when the address text is fully matched with a preset vocabulary list, if it is determined that there is a word in the address text that is the same as a target word in the vocabulary list, the positions of all characters corresponding to the word are assigned to the word vector corresponding to the target vocabulary, and for characters that are not retrieved, they are uniformly assigned to the word vector corresponding to "Other", thereby obtaining the word vector information corresponding to the address text. The word vector corresponding to "Other" can be set according to actual conditions. Fig.10 A schematic diagram of a scenario in which an address recognition model according to an embodiment of the present application performs address recognition on an address text. Fig.10 As shown in the figure, there are five words in the address text, namely "Nanjing", "City", "Yuhuatai", "District", and "Restaurant", which are the same as the target words in the vocabulary list. The positions of all characters corresponding to these five words are assigned to the word vectors corresponding to their corresponding target words. For example, "Nanjing" in the address text is assigned to the word vector corresponding to "Nanjing" in the vocabulary list; and "Restaurant" in the address text is assigned to the word vector corresponding to "Restaurant" in the vocabulary list. For characters that are not retrieved, they will be uniformly assigned to the word vector corresponding to "Other".
[0099] 902, the address recognition model concatenates the character vector information corresponding to the address text and the word vector information to obtain fused vector information. Fig.10 As shown in the figure, the character vector information (character-level Embedding) and the word vector information (vocabulary-level Embedding) are concatenated to obtain fused information.
[0100] In one embodiment of the present application, when splicing character vector information and word vector information, different weights corresponding to the character vector information and the word vector information can be set according to the importance of the character vector information and the word vector information to address recognition respectively; and based on the determined weights, the character vector information and the word vector information are spliced to obtain fused vector information.
[0101] 903, the address recognition model recognizes the fusion vector to obtain an address recognition result.
[0102] For example, Fig.10 As shown, the fusion vector is input into the address recognition model (Bilstm+CRF model) for recognition to obtain the address recognition result.
[0103] The above embodiment can make the fused features contain more semantic information based on the fusion features after merging the character vector information and the word vector information, so that the address recognition model can perform more precise address recognition and obtain more accurate address recognition results, thereby improving the accuracy of address recognition.
[0104] When training the address recognition model on the terminal device, it is necessary to use labeled training data. Labeling the training data requires a large amount of computing power. In order to avoid the situation where the terminal device is stuck due to labeling the training data, in one embodiment of the present application, the terminal device can obtain the training data that has been labeled by the cloud device from the cloud device, and train the address recognition model based on the obtained training data to obtain a trained address recognition model. The technical steps in this embodiment can be Figure 3 The step 304 shown is performed before. Fig.11A schematic diagram of a process for a cloud-side device to perform data labeling according to an embodiment of the present application. Fig.11 As shown, the cloud device can obtain unlabeled scene corpus, such as unlabeled address text data, from multiple acquisition sources. For example, the cloud device can determine the search term of the search corpus based on the scene word and the keyword, and search the search engine and the knowledge base based on the determined search term to obtain the unlabeled address text; the search term can be a hierarchical address term, a POI name, etc. Fig.11 As shown, after the cloud device obtains the unlabeled address text data, it is necessary to perform data processing on the obtained data, such as cleaning and screening, to remove the data of poor quality in the data and obtain the text to be labeled. For example, the text data with garbled characters or special symbols and the text data with short text can be removed from the obtained data. The cloud device divides the text to be labeled into two parts, one part as training text and the other part as test text. For example, 90% of the text to be labeled can be used as training text and 10% of the text to be labeled can be used as test text. The training text can be used to train the annotation model on the cloud device. In one embodiment of the present application, the annotation model can be the Roberta large model. The training text can be preprocessed to obtain pre-labeled data. The preprocessing can include labeling the training text using a rule processing method. For example, the training text can be processed using a pre-set annotation rule to label the training text. After obtaining the pre-labeled data, the obtained pre-labeled data can be used to train the annotation model. The test text can be used to test the annotation model to determine the ability of the annotation model. The test text can be annotated manually to obtain the label corresponding to the test text. In order to avoid problems in manual annotation, the manually annotated test text will be subject to data acceptance to determine whether the label of the test text is normal, so as to obtain annotated data with a high accuracy rate, that is, to obtain the test text with accurate labels.
[0105] like Fig.11 As shown in , the test text that has passed data acceptance can be divided into two parts, one as verification data and the other as test data. Fig.11As shown, the verification data is used to perform model evaluation on the annotation model to obtain the annotation results of the annotation model on the verification data. The annotation results of the annotation model on the verification data can be reviewed by manual review. Based on the review results, the optimization rules of the annotation model are obtained, and the annotation model is adjusted based on the optimization rules. In one embodiment of the present application, the optimization rules may be Badcase optimization rules. Based on the Badcase optimization rules, the input features of the annotation model, the adjustment model structure or hyperparameters, etc. may be modified to improve the performance of the annotation model on incorrectly labeled data. In one embodiment of the present application, the test data may be used to verify the model capabilities of the address recognition model on the terminal device to determine whether the model capabilities of the address recognition model meet the standards.
[0106] The process of labeling model training is an iterative process. The model training process is as follows:
[0107] Step 1: Train the annotation model using pre-annotated data.
[0108] Step 2: Use the verification data to verify the model capability of the annotation model to determine whether the model capability of the annotation model meets the requirements.
[0109] The verification accuracy of the annotation model is determined based on the label of the verification data and the recognition result of the annotation model. The verification accuracy of the annotation model can be determined based on the number of verification failures and successful verifications of the annotation model. For example, when the label of the verification data is different from the recognition result of the annotation model, it is determined that the verification of the annotation model has failed; when the label of the verification data is the same as the recognition result of the annotation model, it is determined that the verification of the annotation model has succeeded. In one embodiment of the present application, whether the model capability of the standard model meets the standard can be determined by the verification accuracy of the verification data. When the verification accuracy of the verification data is greater than or equal to the accuracy threshold, it is determined that the model capability of the standard model meets the standard; when the verification accuracy of the verification data is less than the accuracy threshold, it is determined that the model capability of the standard model does not meet the standard.
[0110] If the model capability of the annotation model meets the standard, the training ends; if the model capability does not meet the standard, proceed to step 3. Step 3: Use the pre-annotated data whose confidence output by the annotation model is greater than or equal to the confidence threshold to retrain the annotation model, and return to Step 2 to verify the model capability of the annotation model using the verification data again. The confidence threshold can be set according to the actual situation.
[0111] In one embodiment of the present application, the annotation model may include a model based on the Roberta large+CRF structure. After decoding, the CRF layer in the annotation model may output a confidence score while outputting the result sequence. The confidence score output by the CRF layer may be directly determined as the confidence output by the annotation model. In one embodiment of the present application, pre-annotated data whose confidence output by the annotation model is less than a confidence threshold may be directly discarded.
[0112] Through the above iterative process, a trained annotation model can be obtained. Fig.11 As shown, when the annotation model is evaluated as qualified, that is, when the model capability of the annotation model meets the standard, the annotation model that has been completed is used to continue to annotate the training text to obtain the annotated training data. In one embodiment of the present application, the annotated training data can be used to train the address recognition model on the terminal device. For some specific implementation methods of training the address recognition model using the annotated training data and the test data obtained based on manual annotation, please refer to the model training process of the annotation model.
[0113] Fig.12 A schematic diagram of a terminal device provided in an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the software system is divided into four layers, namely, the application layer, the framework layer, the system library, and the kernel layer from top to bottom.
[0114] The application layer may include a series of applications. For example, the application may include desktop, clipboard, map, music, short message, gallery, NLU service, navigation, audio and other applications. In one embodiment of the present application, the clipboard may obtain text in other applications based on the copy function to obtain the address text to be identified. For example, the clipboard may obtain text in short messages and chat applications based on the copy function to obtain the address text to be identified. The NLU service may obtain the address text to be identified based on the interaction with the clipboard. In another embodiment of the present application, the OCR module may obtain the address text to be identified based on the recognition of images in the gallery. NLU service The NLU service may obtain the address text to be identified based on the interaction with the OCR module. The NLU service may be built with an address recognition module and an address matching module to realize address recognition of the address text. For the relevant description of the address recognition module and the address matching module, please refer to the relevant description above.
[0115] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a view system, etc.
[0116] The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. In some embodiments of the present application, the window manager can be used to determine whether there is a desktop card on the display interface of the terminal device. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The phone manager is used to provide communication functions for the terminal device. The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables the application to display notification information in the status bar.
[0117] The application layer and framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0118] The system library may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), an image processing library, etc.
[0119] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver. It is understandable that Fig.12 The layers in the software structure shown and the components contained in each layer do not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer layers than shown in the figure, and each layer may include more or fewer components, which is not limited in the present application.
[0120] Fig.13 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Fig.13The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0121] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0122] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc.
[0123] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0124] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I1C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0125] The I1C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). The I2S interface can be used for audio communication.
[0126] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface.
[0127] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
[0128] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the terminal device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the terminal device 100.
[0129] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I1C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0130] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the terminal device 100, and can also be used to transmit data between the terminal device 100 and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other terminal devices 100, such as AR devices, etc.
[0131] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic illustration and does not constitute a structural limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0132] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0133] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, and battery health status (leakage, impedance).
[0134] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0135] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals.
[0136] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the terminal device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
[0137] The wireless communication module 160 can provide wireless communication solutions applied to the terminal device 100, including wireless local area networks (WLAN), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc.
[0138] The terminal device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor that serves abnormality reminders and connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0139] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (QLED), etc.
[0140] In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. The terminal device 100 may implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0141] The camera 193 is used to capture still images or videos. The object is projected onto the photosensitive element by generating an optical image through the lens.
[0142] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0143] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0144] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0145] The audio module 170 is used to convert digital audio information into analog audio signal output, and also used to convert analog audio input into digital audio signal. The audio module 170 can also be used to encode and decode audio signals.
[0146] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal device 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0147] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.
[0148] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the terminal device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.
[0149] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130, or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0150] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 100. The air pressure sensor 180C is used to measure the air pressure. The magnetic sensor 180D includes a Hall sensor. The terminal device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case. The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device 100 in various directions (generally three axes). The distance sensor 180F is used to measure the distance. The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense the brightness of the ambient light. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect the temperature. The touch sensor 180K is also called a "touch device". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". Bone conduction sensor 180M can obtain vibration signals.
[0151] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button. It may also be a touch button. The motor 191 may generate a vibration prompt. The indicator 192 may be an indicator light, which may be used to indicate the charging status, the change of the power, or may be used to indicate messages, missed calls, notifications, etc.
[0152] The SIM card interface 195 is used to connect the SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to realize functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.
[0153] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on the terminal device 100, the terminal device 100 executes the above-mentioned related method steps to implement the address recognition method in the above-mentioned embodiment.
[0154] This embodiment also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the address recognition method in the above-mentioned embodiment.
[0155] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory so that the chip executes the address recognition method in the above-mentioned method embodiments.
[0156] Among them, the terminal device, computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.
[0157] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0158] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0159] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0160] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0161] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. An address recognition method, applied to a terminal device, It is characterized in that The method comprises: Based on the preset address recognition model, address recognition is performed on the address text to be recognized to obtain the address recognition result; Based on the word library pre-stored in the terminal device, performing address matching on the address text to obtain an address matching result; The address recognition result and the address matching result are combined to obtain a target address.
2. The address recognition method according to claim 1, It is characterized in that The step of combining the address recognition result with the address matching result to obtain a target address includes: Determining a subscript of the address recognition result based on a position of the address recognition result in the address text, and determining a subscript of the address matching result based on a position of the address matching result in the address text; Based on the subscripts of the address recognition result and the subscripts of the address matching result, the address recognition result and the address matching result are merged in the order of the subscripts to obtain the target address.
3. The address recognition method according to claim 1, It is characterized in that The step of combining the address recognition result with the address matching result to obtain a target address includes: If it is determined that there is a conflict between the address recognition result and the address matching result, determining a non-conflicting entity in the address recognition result; The non-conflicting entity and the address matching result are combined to obtain the target address.
4. The address recognition method according to claim 1, It is characterized in that The word library includes a global library and a regional library. The global library is used to store a plurality of interest point names in a target country, and the regional library is used to store a plurality of interest point names in a target city.
5. The address recognition method according to claim 4, It is characterized in that The method further comprises: When it is detected that the system of the terminal device is updated, the global library of the terminal device is updated according to the global library in the cloud-side device.
6. The address recognition method according to claim 4, It is characterized in that The method further comprises: When it is detected that the city where the terminal device is located is switched, the regional library is updated so that the updated regional library includes the regional high-frequency full name, regional high-frequency abbreviation and regional low-frequency full name corresponding to the city where the terminal device is currently located.
7. The address recognition method according to claim 4, It is characterized in that The method further comprises: According to the preset analysis cycle and the high-frequency duration threshold, the cities where the terminal device frequently stays in the current analysis cycle are determined, and the regional library is updated according to the cities where the terminal device frequently stays.
8. The address recognition method according to claim 7, It is characterized in that After determining the cities where the terminal device frequently stays in the current analysis period, the method further includes: The high-frequency full names, high-frequency abbreviations and low-frequency full names of regions corresponding to the high-frequency stopover cities in the previous analysis period in the regional database are deleted.
9. The address recognition method according to claim 4, It is characterized in that The method further comprises: When it is detected that the city where the terminal device is located has switched, determining the target historical stay city corresponding to the terminal device from among all the cities where the terminal device has historically stayed according to a preset target number; Based on the determined target historical stay city, the regional database is updated.
10. The address recognition method according to claim 1, It is characterized in that The word library includes a standard address library, which is used to store hierarchical address words. The standard address library corresponds to the standard address library of the cloud side device. The method also includes: updating the standard address library of the word library according to the standard address library updated by the cloud side device.
11. The address recognition method according to any one of claims 1 to 9, It is characterized in that Before performing address recognition on the address text to be recognized based on the preset address recognition model, the method further includes: Acquire, from a cloud-side device, training data annotated by the cloud-side device; The address recognition model is trained based on the acquired training data.
12. A computer-readable storage medium, It is characterized in that The method comprises computer instructions, which, when executed on a terminal device, enable the terminal device to execute the address recognition method according to any one of claims 1 to 11.
13. A terminal device, It is characterized in that The terminal device comprises a processor and a memory, wherein the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the terminal device executes the address identification method according to any one of claims 1 to 11.
