Address translation method and device, electronic equipment and storage medium
By searching similarity in the Chinese pinyin library and constructing translation prompt words, the problem of inaccurate results in English address translation is solved, and the accuracy of Chinese translation results is improved.
Patent Information
- Application Number
- CN202411673293.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-11
AI Technical Summary
The existing technical solution for translating English addresses into Chinese addresses has the problem of inaccurate translation results, especially because the lack of space separation between words and words in English addresses and the pinyin part corresponds to multiple Chinese vocabulary with the same pronunciation but different meanings, which increases the risk of errors during the translation process.
By obtaining the English address data to be translated, similarity search is performed in the Chinese Pinyin library, the target Pinyin-Chinese address data pair is obtained, and the translation prompt words are constructed based on these data, and input them into the translation model to obtain accurate Chinese translation results.
By searching similarity in the Chinese Pinyin library and building translation prompt words, the target pinyin-Chinese address data pairs related to English address data are accurately extracted, which enhances the understanding and processing ability of the translation model to address the context, thereby improving the accuracy of Chinese translation results.
Smart Images

Figure CN119599035A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an address translation method, device, electronic device and storage medium. Background Art
[0002] Since there are no spaces between words in English addresses, they form a continuous string, which makes the word boundaries blurred, leading to misunderstandings and errors in the translation process. In addition, if the English address contains pinyin parts, these pinyins may correspond to multiple Chinese words with the same pronunciation but different meanings, which further increases the risk of errors in the translation process.
[0003] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art: the existing technical solution for translating English addresses into Chinese addresses has the problem of inaccurate translation results. Summary of the invention
[0004] The present invention provides an address translation method, device, electronic device and storage medium to improve the accuracy of translation results.
[0005] According to one aspect of the present invention, there is provided an address translation method, comprising:
[0006] Get the English address data to be translated;
[0007] Based on the English address data to be translated, similarity search is performed in the Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs;
[0008] Constructing a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated;
[0009] The translation prompt word is input into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated.
[0010] According to another aspect of the present invention, there is provided an address translation device, comprising:
[0011] English address data acquisition module, used to acquire English address data to be translated;
[0012] A Chinese Pinyin database similarity search module is used to perform a similarity search in the Chinese Pinyin database based on the English address data to be translated to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs;
[0013] A translation prompt word construction module, used to construct a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated;
[0014] The translation model prediction module is used to input the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated.
[0015] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0016] at least one processor;
[0017] and a memory communicatively coupled to the at least one processor;
[0018] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the address translation method described in any embodiment of the present invention.
[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the address translation method described in any embodiment of the present invention when executed.
[0020] The technical solution of the embodiment of the present invention obtains the English address data to be translated, and then performs a similarity search in the Chinese Pinyin database based on the English address data to be translated to obtain the target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs, and then constructs a translation prompt word based on the target Pinyin-Chinese data pair and the English address data to be translated, and then inputs the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated. The above technical solution can accurately extract the target Pinyin-Chinese address data pair closely related to the English address data by performing a similarity search in the Chinese Pinyin database, and provide prior information for the subsequent translation model reasoning; and then construct a specific prompt word using the target Pinyin-Chinese address data pair, and in the reasoning process of the translation model, the translation model can enhance the understanding and processing capabilities of the address context, thereby improving the accuracy of the Chinese translation result.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flowchart of an address translation method provided according to Embodiment 1 of the present invention;
[0024] Figure 2 is a flowchart of an address translation method provided according to Embodiment 2 of the present invention;
[0025] Figure 3 is a flowchart of an address translation method provided according to Embodiment 3 of the present invention;
[0026] Figure 4 is a flowchart of an address translation method provided according to Embodiment 4 of the present invention;
[0027] Figure 5 is a schematic diagram of the structure of an address translation device provided according to Embodiment 5 of the present invention;
[0028] Figure 6 It is a schematic diagram of the structure of an electronic device for implementing the address translation method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0031] Embodiment 1
[0032] Figure 1 This is a flowchart of an address translation method provided in the first embodiment of the present invention. This embodiment is applicable to the case where an English address is translated into a Chinese address. The method can be executed by an address translation device. The address translation device can be implemented in the form of hardware and / or software. The address translation device can be configured in a terminal and / or a server. Figure 1 As shown, the method includes:
[0033] S110, obtaining English address data to be translated.
[0034] In the embodiment of the present invention, the English address data to be translated refers to the English data to be translated into Chinese containing address information, for example, the English address data may be “Funing County, Yancheng City, Jiangsu Province”.
[0035] Exemplarily, the English address data to be translated may be read from a preset storage path of the electronic device, or the English address data to be translated may be received from other devices that are communicatively connected to the electronic device, which is not specifically limited here.
[0036] S120. Based on the English address data to be translated, similarity search is performed in a Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs.
[0037] In the embodiments of the present invention, the Chinese pinyin library may include multi-level Chinese address texts such as provinces, cities, districts, counties, streets, and detailed addresses across the country, as well as the pinyin corresponding to the Chinese address texts. The Chinese address texts and the pinyin corresponding to the Chinese address texts may be stored in the form of pinyin-Chinese address data pairs. For example, the pinyin-Chinese address data pairs may be "Funing-Funing", "Yancheng-Yancheng", etc.
[0038] Exemplarily, if the English address data to be translated contains "Funing", "Funing" can be searched for similarity in the Chinese pinyin library, and potentially relevant "Funing-Funing" and "Funing-Funing" can be matched. Then, "Funing-Funing" and "Funing-Funing" are used as the target pinyin-Chinese address data pairs to provide prior information for the subsequent translation large model inference.
[0039] S130. Construct a translation prompt based on the target pinyin-Chinese data pairs and the English address data to be translated.
[0040] Among them, the translation prompt refers to the reference data that provides guidance for the large model translation.
[0041] Exemplarily, the target pinyin-Chinese data pairs may be "Jiangsu-Jiangsu", "Yancheng-Yancheng", "Funing-Funing", and "Funing-Funing", and the English address data to be translated may be "Funing County, Yancheng City, Jiangsu Province". The constructed translation prompt may be: According to the retrieved "Jiangsu-Jiangsu", "Yancheng-Yancheng", "Funing-Funing", and "Funing-Funing", translate "Funing County, Yancheng City, Jiangsu Province" into Chinese.
[0042] It should be noted that the translation prompt can guide the translation large model to make full use of the retrieved pinyin-Chinese data pairs for efficient and accurate translation, thereby improving the accuracy of the Chinese translation result.
[0043] S140. Input the translation prompt into the translation large model to obtain the Chinese translation result corresponding to the English address data to be translated.
[0044] In the embodiments of the present invention, the translation large model refers to a large language model that can achieve Chinese-English translation, and the specific model architecture is not limited herein.
[0045] Exemplarily, the above translation prompt words are input into the translation model, and the translation model can output the Chinese translation result corresponding to the English address data to be translated, and the Chinese translation result can be "Funing County, Yancheng City, Jiangsu Province".
[0046] The technical solution of the embodiment of the present invention obtains the English address data to be translated, and then performs a similarity search in the Chinese Pinyin database based on the English address data to be translated to obtain the target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs, and then constructs a translation prompt word based on the target Pinyin-Chinese data pair and the English address data to be translated, and then inputs the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated. The above technical solution can accurately extract the target Pinyin-Chinese address data pair closely related to the English address data by performing a similarity search in the Chinese Pinyin database, and provide prior information for the subsequent translation model reasoning; and then construct a specific prompt word using the target Pinyin-Chinese address data pair, and in the reasoning process of the translation model, the translation model can enhance the understanding and processing capabilities of the address context, thereby improving the accuracy of the Chinese translation result.
[0047] Embodiment 2
[0048] Figure 2 This is a flowchart of an address translation method provided in Embodiment 2 of the present invention. The method of this embodiment can be combined with the various optional solutions in the address translation method provided in the above embodiments. The address translation method provided in this embodiment further limits "based on the English address data to be translated, similarity search is performed in the Chinese Pinyin database to obtain the target Pinyin-Chinese address data pair".
[0049] like Figure 2 As shown, the method includes:
[0050] S210: Obtain English address data to be translated.
[0051] S220: extract key information from the English address data to be translated to obtain key English address information corresponding to the English address data to be translated.
[0052] Among them, the key English address information is one or more of the place names such as province, city and county in the English address data, and is not specifically limited here.
[0053] For example, based on the Trie tree, key information can be extracted from the translated English address data: "The mailing address of Company A is No.1, Yuhua East Road, Chang'an District, Shijiazhuang City, Hebei Province", and the obtained key English address information can be "No.1, Yuhua East Road, Chang'an District, Shijiazhuang City, Hebei Province".
[0054] S230: Perform vector conversion on the key English address information to obtain a key English address text vector corresponding to the key English address information.
[0055] Specifically, the key English address information may be vectorized through the Embedding model, thereby obtaining a key English address text vector corresponding to the key English address information.
[0056] S240, performing similarity matching on the key English address text vector in a Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs.
[0057] In an embodiment of the present invention, all Pinyin-Chinese address data pairs in the Chinese Pinyin library can also be vectorized to obtain a Chinese Pinyin vector corresponding to each Pinyin-Chinese address data pair in the Chinese Pinyin library; further, the similarity between the key English address text vector and the Chinese Pinyin vector corresponding to each Pinyin-Chinese address data pair in the Chinese Pinyin library can be calculated, and then the target Pinyin-Chinese address data pairs can be screened out according to the similarity.
[0058] Optionally, the key English address text vector is matched for similarity in the Chinese Pinyin library to obtain a target Pinyin-Chinese address data pair, including: matching the key English address text vector in the Chinese Pinyin library to obtain multiple candidate Pinyin-Chinese address data pairs; determining the text similarity between the multiple candidate Pinyin-Chinese address data pairs and the key English address text vector respectively; determining the keyword similarity between the multiple candidate Pinyin-Chinese address data pairs and the key English address text vector respectively, and based on the text similarity and keyword similarity, selecting the target Pinyin-Chinese data pair from the multiple candidate Pinyin-Chinese address data pairs.
[0059] Among them, text similarity refers to the similarity between texts, which can be calculated by methods such as TF-IDF. Keyword similarity refers to the similarity between keywords, which can be calculated by methods such as cosine similarity.
[0060] Exemplarily, the text similarity calculation can be performed between the key English address text vector and the Chinese Pinyin vector corresponding to each Pinyin-Chinese address data pair in the Chinese Pinyin library, and then the top 100 Pinyin-Chinese address data pairs with the text similarity ranking are used as candidate Pinyin-Chinese address data pairs. Further, the keyword similarity between the Chinese Pinyin vectors corresponding to the 100 candidate Pinyin-Chinese address data pairs and the key English address text vector is calculated. The comprehensive similarity calculation formula is as follows:
[0061] Comprehensive similarity = W1 × text similarity + W2 × keyword similarity;
[0062] Wherein, W1 and W2 are weight values. Further, the top 10 candidate pinyin-Chinese address data pairs ranked by comprehensive similarity may be used as target pinyin-Chinese data pairs.
[0063] S250: Constructing a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated.
[0064] S260: Input the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated.
[0065] The technical solution of the embodiment of the present invention can accurately extract the target Pinyin-Chinese address data pairs closely related to the key English address information by performing similarity matching on the key English address text vectors in the Chinese Pinyin library, thereby providing prior information for subsequent translation large model reasoning, thereby improving the accuracy of the Chinese translation results.
[0066] Embodiment 3
[0067] Figure 3 This is a flowchart of an address translation method provided in Embodiment 3 of the present invention. The method of this embodiment can be combined with the various optional solutions in the address translation method provided in the above embodiments. The address translation method provided in this embodiment further limits "inputting the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated".
[0068] like Figure 3 As shown, the method includes:
[0069] S310: Obtain English address data to be translated.
[0070] S320: Based on the English address data to be translated, a similarity search is performed in a Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs.
[0071] S330: Construct a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated.
[0072] S340. Obtain multiple groups of Chinese-English address pairs.
[0073] S350: Training a large language model based on the multiple groups of Chinese-English addresses to obtain a large translation model.
[0074] S360: Input the translation prompt word into the translation macro model to obtain a Chinese translation result corresponding to the English address data to be translated.
[0075] In an embodiment of the present invention, in order to improve the stability of the large model translation, a Chinese-English pair training data set is constructed: multiple groups of Chinese-English address pairs; then, the multiple groups of Chinese-English address pairs are used as training data to fine-tune the network parameters of the large language model to improve the accuracy of the large model translation.
[0076] Embodiment 4
[0077] Figure 4 A flowchart of an address translation method provided in Embodiment 4 of the present invention, the method of this embodiment can be combined with the various optional schemes in the address translation method provided in the above embodiments. The address translation method provided in this embodiment is further optimized. Optionally, after inputting the translation prompt word into the translation big model to obtain the Chinese translation result corresponding to the English address data to be translated, it also includes: performing address verification on the Chinese translation result to obtain the verification result of the Chinese translation result.
[0078] like Figure 4 As shown, the method includes:
[0079] S410: Obtain English address data to be translated.
[0080] S420: Based on the English address data to be translated, similarity search is performed in the Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs.
[0081] S430: construct a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated.
[0082] S440: Input the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated.
[0083] S450: Perform address verification on the Chinese translation result to obtain a verification result of the Chinese translation result.
[0084] In the embodiment of the present invention, address verification refers to verifying whether the Chinese translation result is correct. It should be noted that by performing address verification on the Chinese translation result, accurate Chinese translation addresses can be screened out, thereby ensuring the accuracy of the Chinese translation result.
[0085] Optionally, an address verification is performed on the Chinese translation result to obtain a verification result of the Chinese translation result, including: extracting key information from the Chinese translation result to obtain key Chinese address information corresponding to the Chinese translation result; converting the key Chinese address information into pinyin to obtain key pinyin address information corresponding to the key Chinese address information; comparing the key pinyin address information with the key English address information; if the comparison result is that the key pinyin address information is the same as the key English address information, then determining that the verification result of the Chinese translation result is accurate.
[0086] Exemplarily, the Chinese translation result may be "Funing County, Yancheng City, Jiangsu Province". After extracting key information from "Funing County, Yancheng City, Jiangsu Province", the key Chinese address information obtained may be: "Funing"; Funing is converted into pinyin to obtain "funing"; if the key pinyin address information and the key English address information are both or both contain "funing", the verification result of the Chinese translation result is determined to be accurate.
[0087] Optionally, an address verification is performed on the Chinese translation result to obtain a verification result of the Chinese translation result, including: matching the Chinese translation result in a standard Chinese address library to obtain a target Chinese address, wherein the standard Chinese address library includes multiple pre-built Chinese addresses; if the similarity between the Chinese translation result and the target Chinese address is greater than a preset similarity threshold, then the verification result of the Chinese translation result is determined to be accurate.
[0088] Among them, the standard Chinese address library may include multiple pre-built Chinese addresses, for example, the Chinese address may be "Funing County, Yancheng City, Jiangsu Province" or "Funing County, Wenshan Prefecture, Yunnan Province", etc.
[0089] For example, the Chinese translation result may be "Funing County, Yancheng City, Jiangsu Province". "Funing County, Yancheng City, Jiangsu Province" is matched in the standard Chinese address database, and the target Chinese address obtained is "Funing County, Yancheng City, Jiangsu Province". The similarity between "Funing County, Yancheng City, Jiangsu Province" and "Funing County, Yancheng City, Jiangsu Province" is calculated. If the similarity calculation result is not greater than the preset similarity threshold, it indicates that there is an error in the Chinese translation result, so the Chinese translation result can be corrected to "Funing County, Yancheng City, Jiangsu Province".
[0090] The technical solution of the embodiment of the present invention can screen out accurate Chinese translation addresses and promptly correct erroneous translations by performing address verification on Chinese translation results, thereby ensuring the accuracy of Chinese translation results.
[0091] Embodiment 5
[0092] Figure 5 This is a schematic diagram of the structure of an address translation device provided in Embodiment 5 of the present invention. Figure 5 As shown, the device comprises:
[0093] English address data acquisition module 510, used to acquire English address data to be translated;
[0094] A Chinese Pinyin database similarity search module 520 is used to perform a similarity search in the Chinese Pinyin database based on the English address data to be translated to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs;
[0095] A translation prompt word construction module 530, used to construct a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated;
[0096] The translation model prediction module 540 is used to input the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated.
[0097] The technical solution of the embodiment of the present invention obtains the English address data to be translated, and then performs a similarity search in the Chinese Pinyin database based on the English address data to be translated to obtain the target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs, and then constructs a translation prompt word based on the target Pinyin-Chinese data pair and the English address data to be translated, and then inputs the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated. The above technical solution can accurately extract the target Pinyin-Chinese address data pair closely related to the English address data by performing a similarity search in the Chinese Pinyin database, and provide prior information for the subsequent translation model reasoning; and then construct a specific prompt word using the target Pinyin-Chinese address data pair, and in the reasoning process of the translation model, the translation model can enhance the understanding and processing capabilities of the address context, thereby improving the accuracy of the Chinese translation result.
[0098] In some optional implementations, the Chinese Pinyin library similarity retrieval module 520 includes:
[0099] A key information extraction unit, used to extract key information from the English address data to be translated, and obtain key English address information corresponding to the English address data to be translated;
[0100] A vector conversion unit, used for performing vector conversion on the key English address information to obtain a key English address text vector corresponding to the key English address information;
[0101] The similarity matching unit is used to perform similarity matching on the key English address text vector in the Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair.
[0102] In some optional implementations, the similarity matching unit may be further configured to:
[0103] Matching the key English address text vector in the Chinese Pinyin database to obtain multiple candidate Pinyin-Chinese address data pairs;
[0104] Determine the text similarity between a plurality of candidate Pinyin-Chinese address data pairs and the key English address text vector respectively;
[0105] Determine the keyword similarity between a plurality of candidate pinyin-Chinese address data pairs and the key English address text vector respectively,
[0106] Based on the text similarity and the keyword similarity, a target Pinyin-Chinese data pair is screened out from the plurality of candidate Pinyin-Chinese address data pairs.
[0107] In some optional implementations, the translation model prediction module 540 may also be used to:
[0108] Get multiple Chinese-English address pairs;
[0109] Training a large language model based on the multiple groups of Chinese-English addresses to obtain a translation large model;
[0110] The translation prompt word is input into the translation macro model to obtain the Chinese translation result corresponding to the English address data to be translated.
[0111] In some optional implementations, the address translation device includes:
[0112] The address verification module is used to perform address verification on the Chinese translation result to obtain a verification result of the Chinese translation result.
[0113] In some optional implementations, the address verification module may be specifically used for:
[0114] Extracting key information from the Chinese translation result to obtain key Chinese address information corresponding to the Chinese translation result;
[0115] Performing pinyin conversion on the key Chinese address information to obtain key pinyin address information corresponding to the key Chinese address information;
[0116] Comparing the key pinyin address information with the key English address information;
[0117] If the comparison result is that the key pinyin address information is the same as the key English address information, then the verification result of the Chinese translation result is determined to be accurate.
[0118] In some optional implementations, the address verification module may be further used for:
[0119] Matching the Chinese translation result in a standard Chinese address database to obtain a target Chinese address, wherein the standard Chinese address database includes a plurality of pre-built Chinese addresses;
[0120] If the similarity between the Chinese translation result and the target Chinese address is greater than a preset similarity threshold, it is determined that the verification result of the Chinese translation result is accurate.
[0121] The address translation device provided in the embodiment of the present invention can execute the address translation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0122] Embodiment 6
[0123] Figure 6A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0124] like Figure 6 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The I / O interface 15 is also connected to the bus 14.
[0125] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0126] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as an address translation method, which includes:
[0127] Get the English address data to be translated;
[0128] Based on the English address data to be translated, similarity search is performed in the Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs;
[0129] Constructing a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated;
[0130] The translation prompt word is input into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated.
[0131] In some embodiments, the address translation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the address translation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the address translation method in any other appropriate manner (e.g., by means of firmware).
[0132] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0133] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0134] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0135] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0136] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0137] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0138] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0139] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An address translation method, characterized in that: include: Get the English address data to be translated; Based on the English address data to be translated, similarity search is performed in the Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs; Constructing a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated; The translation prompt word is input into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated.
2. The method according to claim 1, characterized in that Based on the English address data to be translated, similarity search is performed in the Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair, including: Extracting key information from the English address data to be translated to obtain key English address information corresponding to the English address data to be translated; Performing vector conversion on the key English address information to obtain a key English address text vector corresponding to the key English address information; The key English address text vector is matched for similarity in the Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair.
3. The method according to claim 2, characterized in that The method of performing similarity matching on the key English address text vector in the Chinese Pinyin database to obtain a target Pinyin-Chinese address data pair includes: Matching the key English address text vector in the Chinese Pinyin database to obtain multiple candidate Pinyin-Chinese address data pairs; Determine the text similarity between a plurality of candidate Pinyin-Chinese address data pairs and the key English address text vector respectively; Determine the keyword similarity between a plurality of candidate pinyin-Chinese address data pairs and the key English address text vector respectively, Based on the text similarity and the keyword similarity, a target Pinyin-Chinese data pair is screened out from the plurality of candidate Pinyin-Chinese address data pairs.
4. The method according to claim 1, characterized in that: The step of inputting the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated includes: Get multiple Chinese-English address pairs; Training a large language model based on the multiple groups of Chinese-English addresses to obtain a translation large model; The translation prompt word is input into the translation macro model to obtain the Chinese translation result corresponding to the English address data to be translated.
5. The method according to any one of claims 1 to 4, characterized in that: After inputting the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated, the method further includes: An address check is performed on the Chinese translation result to obtain a check result of the Chinese translation result.
6. The method according to claim 5, characterized in that The address verification of the Chinese translation result is performed to obtain the verification result of the Chinese translation result, including: Extracting key information from the Chinese translation result to obtain key Chinese address information corresponding to the Chinese translation result; Performing pinyin conversion on the key Chinese address information to obtain key pinyin address information corresponding to the key Chinese address information; Comparing the key pinyin address information with the key English address information; If the comparison result is that the key pinyin address information is the same as the key English address information, then the verification result of the Chinese translation result is determined to be accurate.
7. The method according to claim 5, characterized in that The address verification of the Chinese translation result is performed to obtain the verification result of the Chinese translation result, including: Matching the Chinese translation result in a standard Chinese address database to obtain a target Chinese address, wherein the standard Chinese address database includes a plurality of pre-built Chinese addresses; If the similarity between the Chinese translation result and the target Chinese address is greater than a preset similarity threshold, it is determined that the verification result of the Chinese translation result is accurate.
8. An address translation device, characterized in that: include: English address data acquisition module, used to acquire English address data to be translated; A Chinese Pinyin database similarity search module is used to perform a similarity search in the Chinese Pinyin database based on the English address data to be translated to obtain a target Pinyin-Chinese address data pair, wherein the Chinese Pinyin database includes a plurality of pre-constructed Pinyin-Chinese address data pairs; A translation prompt word construction module, used to construct a translation prompt word based on the target pinyin-Chinese data pair and the English address data to be translated; The translation model prediction module is used to input the translation prompt word into the translation model to obtain the Chinese translation result corresponding to the English address data to be translated.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the address translation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the address translation method according to any one of claims 1 to 7 when executed.