Place name translation method and device, equipment and storage medium

By constructing a dictionary based on official geographic and map data and fine-tuning the place name translation model, the problem of inaccuracy in place name translation in multilingual and multicultural areas was solved, achieving accuracy and consistency in place name translation.

CN121328575APending Publication Date: 2026-01-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410946292.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Traditional translation methods are prone to mistranslation or inconsistency in translating place names in multilingual and multicultural regions, especially in areas using unique phonetic systems, such as Cantonese-speaking regions, leading to inaccurate place name translations.

Method used

A dictionary based on official geographic and map data is constructed. By fine-tuning the place name translation model, the first and second dictionaries are used in combination for translation to ensure the accuracy and consistency of place name translation.

Benefits of technology

By employing a multi-layered translation calibration process, the accuracy and consistency of place name translations have been improved, resolving the mistranslation issues present in traditional translation methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121328575A_ABST
    Figure CN121328575A_ABST
Patent Text Reader

Abstract

The invention provides a place name translation method and device, equipment and a storage medium, which can be applied to the technical fields of artificial intelligence, maps and the like, and comprises the following steps: acquiring a first language name of a target place in a first region, and loading at least one of a first dictionary and a second dictionary, the first dictionary comprises a corresponding relation between first language names and second language names of N places of the first area determined based on official geographic data of the first area, and the second dictionary comprises a corresponding relation between first language names and second language names of M places of the first area determined based on map data of the first area; the first language name of the target location is translated through at least one of a first dictionary, a second dictionary and a place name translation model, a second language name of the target location is obtained, and the place name translation model is obtained by using at least one of the first dictionary and the second dictionary to perform fine adjustment on a pre-trained language model. And the accuracy of place name translation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer, and particularly relate to a place name translation method, device, equipment and storage medium. BACKGROUND

[0002] With the rapid development of computer technology, place names can be translated by machines to realize conversion between multiple languages, especially by using statistical and neural network models.

[0003] However, for the region where multiple languages and cultures intersect, the region has a unique language background, and the used pinyin is different from the pinyin of Mandarin in many aspects, resulting in the problem of misinterpretation or inconsistent translation when using traditional translation methods. SUMMARY

[0004] The present application provides a place name translation method, device, equipment and storage medium, which can improve the accuracy of place name translation.

[0005] In a first aspect, the present application provides a place name translation method, comprising:

[0006] obtaining a first language name of a target place in a first region, and loading at least one of a first dictionary and a second dictionary, the first dictionary comprising a corresponding relationship between a first language name and a second language name of N places in the first region determined based on official geographic data of the first region, and the second dictionary comprising a corresponding relationship between a first language name and a second language name of M places in the first region determined based on map data of the first region, wherein N and M are positive integers;

[0007] translating the first language name of the target place by at least one of the first dictionary, the second dictionary and a place name translation model to obtain a second language name of the target place, wherein the place name translation model is obtained by fine-tuning a pre-trained language model using at least one of the first dictionary and the second dictionary.

[0008] In a second aspect, the present application provides a place name translation method applied to a terminal device, comprising:

[0009] displaying a place name translation input interface;

[0010] receiving a first language name of a target place in a first region input by a user in the place name translation input interface;

[0011] displaying a second language name of the target place;

[0012] The second language name of the target place is obtained by translating the first language name of the target place based on at least one of the first dictionary, the second dictionary and a place name translation model, the first dictionary includes a corresponding relationship between the first language names and the second language names of N places in the first region determined based on official geographic data of the first region, and the second dictionary includes a corresponding relationship between the first language names and the second language names of M places in the first region determined based on map data of the first region, where N and M are positive integers.

[0013] In a third aspect, the present application provides a place name translation device, comprising:

[0014] The obtaining unit is configured to obtain a first language name of a target place in a first region, and load at least one of a first dictionary and a second dictionary, the first dictionary includes a corresponding relationship between the first language names and the second language names of N places in the first region determined based on official geographic data of the first region, and the second dictionary includes a corresponding relationship between the first language names and the second language names of M places in the first region determined based on map data of the first region, where N and M are positive integers.

[0015] The translation unit is configured to translate the first language name of the target place based on at least one of the first dictionary, the second dictionary and a place name translation model to obtain a second language name of the target place, and the place name translation model is obtained by fine-tuning a pre-trained language model based on at least one of the first dictionary and the second dictionary.

[0016] In some embodiments, the translation unit is specifically configured to query the second language name of the target place in at least one of the first dictionary and the second dictionary based on the first language name of the target place, and translate the first language name of the target place based on the place name translation model to obtain the second language name of the target place if the second language name of the target place is not queried in the first dictionary and the second dictionary.

[0017] In some embodiments, the translation unit is specifically configured to query the second language name of the target place in a corresponding relationship between the first language names and the second language names of N places included in the first dictionary based on the first language name of the target place, and query at least one language name of the target place in a corresponding relationship between the first language names and the second language names of M places included in the second dictionary based on the first language name of the target place if the second language name of the target place is not queried in the first dictionary.

[0018] In some embodiments, the translation unit is specifically configured to acquire list data corresponding to each of the plurality of locations in the first region, the list data including at least different language names of the location and a peripheral neighboring location of the location; query the second language name of the target location in the list data corresponding to each of the plurality of locations based on the first language name of the target location; and if the second language name of the target location is not found in the list data corresponding to each of the plurality of locations, translate the first language name of the target location to obtain the second language name of the target location by using the place name translation model.

[0019] In some embodiments, the translation unit is specifically configured to acquire list data corresponding to the target location based on the first language name of the target location if it is determined that the target location is included in the plurality of locations; and determine the first second language name in the location name of the list data corresponding to the target location as the second language name of the target location.

[0020] In some embodiments, the acquisition unit is specifically configured to acquire a first request sent by an object, the first request including the first language name of the target location; and load at least one of the loaded first dictionary and the second dictionary if the first request is used to request translation of the first language name of the target location into a second language name.

[0021] In some embodiments, the translation unit is further configured to, if the first request includes a translated name of the target location input by the object and the first request is used to request a judgment on whether the translated name is Chinese pinyin, parse the first request to obtain the translated name of the target location input by the object; and perform Chinese pinyin detection on the translated name to obtain a Chinese pinyin detection result of the translated name.

[0022] In some embodiments, the translation unit is further configured to, if the first request includes a translated name of the target location input by the object and the first request is used to request a judgment on whether the translated name is Chinese pinyin and request the second language name of the target location, parse the first request to obtain the translated name of the target location input by the object; perform Chinese pinyin detection on the translated name to obtain a Chinese pinyin detection result of the translated name; if the translated name input by the object is Chinese pinyin, load at least one of the loaded first dictionary and the second dictionary, and translate the first language name of the target location based on at least one of the first dictionary, the second dictionary, and the place name translation model to obtain the second language name of the target location; and replace the translated name input by the object with the second language name of the target location.

[0023] In some embodiments, the translation unit is further configured to, if the first request is for requesting automatic translation of the second language name of the target location, translate the first language name of the target location into the second language name of the target location by using the location translation model.

[0024] In some embodiments, the translation unit is further configured to obtain the first language names of locations in the first region; based on the first language names of locations in the first region, obtain official geographic data of the first region from public data of an official location information system of the first region; and based on the official geographic data of the first region, extract a correspondence between the first language names and the second language names of N locations in the first region to construct a first dictionary of the first region.

[0025] In some embodiments, the translation unit is further configured to, based on the first language names of locations in the first region, search for list data corresponding to the locations in the first region from map data of the first region, wherein the list data at least includes different language names of the locations and neighboring locations of the locations; and based on the list data corresponding to the locations in the first region, extract a correspondence between the first language names and the second language names of M locations in the first region to construct a second dictionary of the first region.

[0026] In some embodiments, the translation unit is further configured to, for an i-th location in the first region, based on the first language name of the i-th location, obtain, from the map data of the first region, multiple language names of locations within a preset radius range of the i-th location to obtain list data corresponding to the i-th location, wherein i is a positive integer.

[0027] In some embodiments, the translation unit is further configured to obtain a pre-trained language model; and fine-tune the pre-trained language model by using at least one of the first dictionary and the second dictionary to obtain the location name translation model.

[0028] In some embodiments, the translation unit is further configured to, based on location name translation features of the first region, construct a translation prompt template for indicating translation of the first language names of locations in the first region into the second language names; process data included in at least one of the first dictionary and the second dictionary based on the translation prompt template to obtain multiple prompt examples, wherein the prompt examples include the first language names and the second language names of locations in the first region; and fine-tune the pre-trained language model by using the multiple prompt examples to obtain the location name translation model.

[0029] In a fourth aspect, the present application provides a place name translation device applied to a terminal device, comprising:

[0030] an interface display unit configured to display a place name translation input interface;

[0031] a receiving unit configured to receive a first language name of a target place input by an object in a first region in the place name translation input interface;

[0032] a translation display unit configured to display a second language name of the target place, wherein the second language name of the target place is obtained by translating the first language name of the target place based on at least one of a first dictionary, a second dictionary and a place name translation model, the first dictionary comprising a corresponding relationship between first language names and second language names of N places in a first region determined based on official geographic data of the first region, the second dictionary comprising a corresponding relationship between first language names and second language names of M places in the first region determined based on map data of the first region, and N and M are positive integers.

[0033] In some embodiments, the interface display unit is further configured to display a translation function selection interface, the translation function selection interface comprising at least one of a place name translation option, a pinyin detection option, a pinyin replacement option and an automatic translation option; and the display place name translation input interface is displayed in response to a triggering operation of the object on the place name translation option.

[0034] In a fifth aspect, an electronic device is provided, comprising a processor and a memory. The memory is configured to store a computer program, and the processor is configured to invoke and run the computer program stored in the memory to execute the method in the first aspect or the second aspect and each implementation manner thereof.

[0035] In a sixth aspect, a chip is provided for implementing the method in any of the first aspect and each implementation manner thereof. Specifically, the chip comprises a processor configured to invoke and run a computer program from a memory, so that a device installed with the chip executes the method in any of the first aspect or the second aspect and each implementation manner thereof.

[0036] In a seventh aspect, a computer readable storage medium is provided for storing a computer program, the computer program causing a computer to execute the method in the first aspect and each implementation manner thereof.

[0037] In an eighth aspect, a computer program product is provided, comprising computer program instructions, the computer program instructions causing a computer to execute the method in the first aspect and each implementation manner thereof.

[0038] In a ninth aspect, a computer program is provided, which, when running on a computer, causes the computer to perform the method of the first aspect above and the implementation manners thereof.

[0039] To sum up, the embodiment of the present application first constructs a first dictionary based on the official geographic data of the first region, the first dictionary including the corresponding relationship between the first language name and the second language name of the N places in the first region, and constructs a second dictionary based on the map data of the first region, the second dictionary including the corresponding relationship between the first language name and the second language name of the M places in the first region, and uses at least one of the first dictionary and the second dictionary to fine-tune the place name translation model, so that the place name translation model accurately translates the place name in the first region. In this way, when translating the place name, the first language name of the target place in the first region is obtained, and at least one of the first dictionary and the second dictionary is loaded, and then based on at least one of the first dictionary, the second dictionary and the fine-tuned place name translation model, the first language name of the target place is translated to obtain the second language name of the target place. That is, the embodiment of the present application ensures the accuracy and consistency of the place name translation in the first region by comprehensively using the official geographic data and the map data of the first region and through the multi-layer translation calibration process. BRIEF DESCRIPTION OF DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.

[0041] Figure 1 An implementation environment schematic diagram of the place name translation method provided by the embodiment of the present application;

[0042] Figure 2 A flowchart of the place name translation method provided by an embodiment of the present application;

[0043] Figure 3 A training schematic diagram of the place name translation model;

[0044] Figure 4 Another training schematic diagram of the place name translation model;

[0045] Figure 5 A flowchart of the place name translation method provided by an embodiment of the present application;

[0046] Figure 6 A schematic diagram of a way of inputting the first language name of the target place;

[0047] Figure 7This is a schematic diagram illustrating a place name translation method according to an embodiment of this application;

[0048] Figure 8 This is a schematic diagram illustrating another method of translating place names according to an embodiment of this application;

[0049] Figure 9 A flowchart illustrating a place name translation method provided in an embodiment of this application;

[0050] Figure 10 This is a schematic diagram showing the place name translation input interface;

[0051] Figure 11A A schematic diagram of the selection interface for the translation function;

[0052] Figure 11B Another illustration showing the place name translation input interface;

[0053] Figure 12 A diagram illustrating the input of the first language name of the target location;

[0054] Figure 13A This is a diagram illustrating the detection of Chinese Pinyin.

[0055] Figure 13B This is a diagram illustrating the results of the Chinese Pinyin detection.

[0056] Figure 14A This is a diagram illustrating the pinyin replacement process.

[0057] Figure 14B This is a diagram illustrating the results of the pinyin replacement.

[0058] Figure 15A This is an illustration of automatic translation;

[0059] Figure 15B This is a diagram illustrating the automatic translation results;

[0060] Figure 16 This is a schematic block diagram of a place name translation device provided in one embodiment of this application;

[0061] Figure 17 This is a schematic block diagram of a place name translation device provided in one embodiment of this application;

[0062] Figure 18 This is a schematic block diagram of the electronic device provided in the embodiments of this application. Detailed Implementation

[0063] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0064] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein. In embodiments of the invention, "B corresponding to A" means that B is associated with A. In one implementation, B can be determined based on A. However, it should also be understood that determining B based on A does not mean determining B solely based on A; B can also be determined based on A and / or other information. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0065] The technical solution proposed in this application can be applied to the fields of artificial intelligence (e.g., to mixed-source large model), mapping, etc., and is used to accurately translate the first language name (e.g., Chinese name) of a target location in a first region into a second language name (e.g., English name).

[0066] The relevant concepts involved in the embodiments of this application are introduced below.

[0067] Prompts are text instructions used to activate and guide specific functions of a large-scale language model, informing it to generate specific types of output to accomplish a particular task. They play a crucial role by using well-designed questions and scenarios to activate and guide the model along specific lines of thought or tasks.

[0068] Few-shot learning is a machine learning technique that aims to enable a model to quickly learn new tasks or concepts from a very small amount of training data. This method is particularly useful in situations where data is scarce or costly, as it reduces the dependence on large-scale labeled datasets. In applications such as machine translation or natural language processing, few-shot learning can help a model quickly adapt to new language environments, technical terms, or specific regional language rules without having to retrain the entire model.

[0069] In the translation of place names, in regions where multiple languages and cultures converge, the region has a unique language background, and the pinyin used is different from Mandarin pinyin in many aspects. When using traditional translation methods, there are often problems of mistranslation or inconsistent translation. Take the Cantonese region as an example. A unique official pinyin system is widely used. This system is not only used for transliterating place names with non-Roman letters but also for annotating words with unclear pronunciations. However, this official pinyin is significantly different from Chinese pinyin, resulting in frequent mistranslations and inconsistent translations when traditional translation systems face place names in these regions. For example, "太子" as a subway station name should be "tàizǐ" in Chinese pinyin, but its actual spelling in the official pinyin system of this region is "Prince Edward". In addition, there are problems such as polyphones and homophonic characters with different forms in the Cantonese pinyin system itself, leading to easy mistranslations in place name translation. For example, "元朗" is "Yuen Long" in Cantonese pinyin, which is different from Chinese pinyin "Yuánlǎng". And for the translation of some place names with personal name nature, such as "宝琳" which is translated as "Po Lam" in Cantonese pinyin, while machine translation gives Pauline (a name). Furthermore, existing machine translation schemes usually rely on extensive corpora and statistical models and are difficult to fully capture the pinyin rules and cultural backgrounds unique to special regions, thus unable to accurately translate the place names in these regions.

[0070] To address this technical problem, this application first constructs a first dictionary based on official geographic data of a first region. This first dictionary includes the correspondence between the first and second language names of N locations in the first region. Then, based on map data of the first region, a second dictionary is constructed, including the correspondence between the first and second language names of M locations in the first region. At least one of the first and second dictionaries is used to fine-tune the place name translation model, ensuring accurate translation of place names in the first region. Thus, during place name translation, the first language name of the target location in the first region is obtained, and at least one of the first and second dictionaries is loaded. Then, based on the first dictionary, the second dictionary, and at least one of the fine-tuned place name translation model, the first language name of the target location is translated to obtain the second language name of the target location. In other words, this application, by integrating official geographic data and map data of the first region and employing a multi-layered translation calibration process, ensures the accuracy and consistency of place name translation in the first region.

[0071] The implementation environment of the place name translation method provided in the embodiments of this application is described below.

[0072] Figure 1 This is a schematic diagram of an implementation environment for the place name translation method provided in this application, including a terminal device 101 and a server 102. The terminal device 101 and the server 102 can communicate with each other via wired or wireless means.

[0073] In this embodiment, the object and the terminal device 101 can interact with each other. For example, the object can input the first language name of the target place name to be translated on the terminal device 101. The terminal device 101 can also present the translation result of the target place name to the object, such as presenting the second language name of the target place name to the object. The server 102 has data processing functions.

[0074] In this embodiment, server 102 includes a pre-trained place name translation model. First, server 102 acquires official geographic data for a first region and constructs a first dictionary based on this data. This first dictionary includes the correspondence between the first and second language names of N locations in the first region. Simultaneously, server 102 acquires map data for the first region and constructs a second dictionary based on this data. This second dictionary includes the correspondence between the first and second language names of M locations in the first region. Next, server 102 uses at least one of the first and second dictionaries to fine-tune a language model (optionally, this language model can be a mixed-source large model) to obtain a trained place name translation model.

[0075] In some embodiments of this application, the place name translation method is primarily performed by a server. The user can input the first language name of the target place name to be translated on a terminal device 101. The terminal device 101 sends the first language name of the target place name to a server 102. The server 102 loads at least one of a first dictionary and a second dictionary. Then, based on at least one of the first dictionary, the second dictionary, and a place name translation model, the server 102 translates the first language name of the target location to obtain the second language name of the target location. The server 102 sends the second language name of the target location to the terminal device 101 for display. In this way, by integrating official geographic data and map data of the first region and through a multi-layered translation calibration process, the accuracy and consistency of place name translation in the first region are ensured.

[0076] In some embodiments of this application, the place name translation method is mainly performed by a terminal device. Server 102 includes a trained place name translation model. In this application embodiment, an object can input the first language name of a target location to be translated on terminal device 101. Based on the first language name of the target location input by the object, terminal device 101 sends a request to server 102, which requests at least one of a first dictionary and a second dictionary, and requests a place name translation model. Server 102 sends at least one of the first dictionary and the second dictionary to terminal device 101, and also sends the trained place name translation model to terminal device 101. Terminal device 101 translates the first language name of the target location based on at least one of the first dictionary, the second dictionary, and the place name translation model, obtaining the second language name of the target location, and displays the second language name of the target location. Thus, by integrating official geographical data and map data of the first region, and through a multi-layered translation calibration process, the accuracy and consistency of place name translation in the first region are ensured.

[0077] This application does not limit the specific type of the terminal device 101. In some embodiments, the terminal device 101 may include, but is not limited to: mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, wearable smart devices, medical devices, etc. The device is often equipped with a display device, which may also be a monitor, display screen, touch screen, etc., and the touch screen may also be a touch screen, touch panel, etc.

[0078] In some embodiments, there may be one or more servers. When there are multiple servers, at least two servers are used to provide different services, and / or at least two servers are used to provide the same service, such as providing the same service in a load-balanced manner. This application embodiment does not limit this. The aforementioned servers may be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Servers may also become nodes in a blockchain.

[0079] In this embodiment, the terminal device 101 and the server 102 can be directly or indirectly connected through wired or wireless communication, and this application does not impose any restrictions.

[0080] It should be noted that the implementation environment of this application embodiment includes, but is not limited to, Figure 1 As shown.

[0081] The technical solutions of the embodiments of this application will be described in detail below through some examples. The following embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0082] First, we will introduce the process of constructing the first dictionary and the second dictionary, and the process of using the first dictionary and the second dictionary to train the model.

[0083] Figure 2 This is a flowchart illustrating a place name translation method provided in one embodiment of this application. The execution entity of this embodiment is a device with data processing capabilities, such as a data processing apparatus. In some embodiments, the execution entity of this embodiment may be... Figure 1 The server in, or for Figure 1 Terminal devices in, or for Figure 1 The system consists of a server and terminal devices. For ease of description, this application uses an electronic device as an example for illustration.

[0084] like Figure 2 As shown, the place name translation process in this application embodiment includes:

[0085] S101. Obtain the first language name of each location in the first region.

[0086] In the embodiments of the present application, there is no limitation on the specific type of the first region. It can be understood that in a region where the official pinyin used is not exactly the same as the official pinyin of the country where the first region is located, problems such as incorrect translation or inconsistent translation often occur when using traditional translation methods.

[0087] In one example, the first region can be a Cantonese region. For example, "Prince Edward" is the name of a subway station. In standard Mandarin pinyin, it should be "tàizǐ", but in the Cantonese pinyin system, it is actually spelled as "Prince Edward". Another example is that "Yuen Long" in Cantonese pinyin is different from the pinyin "Yuánlǎng" in Mandarin.

[0088] In the embodiments of the present application, the translation of a place name can be understood as translating the name of a place in the first region in the first language into the name in the second language. In the embodiments of the present application, there is no limitation on the specific language categories corresponding to the first language name and the second language name, as long as the first language name and the second language name are different.

[0089] In one example, the first language name can be a Chinese name, and the second language name can be an English name. That is, the place name translation in the embodiments of the present application is to translate the Chinese name of a place in the first region into an English name.

[0090] In the embodiments of the present application, when translating the place names in the first region, the translation is based on the first dictionary, the second dictionary, and the place name translation model. That is to say, to achieve place name translation in the embodiments of the present application, it is necessary to construct the first dictionary and the second dictionary of the first region, and complete the training of the place name translation model. The construction processes of the first dictionary and the second dictionary are introduced below.

[0091] In the embodiments of the present application, in order to construct the first dictionary and the second dictionary, it is first necessary to obtain the first language names of each place in the first region.

[0092] In the embodiments of the present application, there is no limitation on the specific manner in which the electronic device obtains the first language names of each place in the first region.

[0093] In one possible implementation, the electronic device uses web crawler technology to crawl geographical information and place data related to the first region from the Internet.

[0094] In one possible implementation, in addition to collecting data through web crawling technology, the electronic device can also extract geographic information and location data related to the first region from various files. For example, it can identify geographic information and location data related to the first region from PDF, Excel, and TXT files. By extracting place name information and place name data related to the first region from these files, the amount of data can be effectively expanded.

[0095] It should be noted that the following aspects require special attention during the data collection process:

[0096] The first is data quality, ensuring that the collected data is accurate and highly reliable. This is further enhanced through manual review and annotation.

[0097] The second factor is the amount of data. To train a high-performance place name translation model, a sufficient amount of place name data needs to be collected. Generally speaking, the larger the amount of data, the better the model training effect.

[0098] The third is domain relevance; the collected data must be closely related to the geographical information of the first region to ensure the professionalism and accuracy of place name translation.

[0099] Based on the above steps, the electronic device collects relevant geographic information and location data for the first region and then preprocesses this data.

[0100] For example, key steps in the preprocessing of the collected geographic information and location data related to the first region by the electronic device include noise removal and text segmentation. Noise removal primarily involves cleaning the text data, removing irrelevant special symbols, numbers, and non-text elements to ensure data purity. Text segmentation mainly involves appropriately cutting long texts, for example, ensuring the length of the segmented text is suitable for the input text length of the place name translation model. This helps improve the model's understanding and translation efficiency.

[0101] After the electronic device preprocesses the collected geographic information and location data related to the first region, it constructs a vocabulary. That is, based on the collected data, a comprehensive vocabulary is constructed, which includes the first language names of key locations such as place names and street names unique to the first region.

[0102] For example, the vocabulary of the first language names of various locations in the first region generated in this step is shown in Table 1:

[0103] Table 1

[0104] Different locations of the first region First language names of the locations Location 1 First language name 1 Location 2 First language name 2 …… ……

[0105] As can be seen from the above, this step is mainly used to obtain the first language names of all locations in the first region in order to prepare for generating the first dictionary, the second dictionary, and training the place name translation model.

[0106] S102. Based on the first language names of various locations in the first region, obtain the official geographic data of the first region from the publicly available data of the official location information system of the first region.

[0107] In this embodiment of the application, in order to achieve accurate translation of place names in the first region, official geographic data of the first region is obtained, and then a first dictionary for the first region is constructed based on the official geographic data of the first region. Specifically, the electronic device obtains the official geographic data of the first region from the publicly available data of the official location information system of the first region, based on the first language names of various locations in the first region obtained above.

[0108] For example, an electronic device uses web crawler technology to send a query request to the public API of the official geographic information system of a first region. This query request is used to obtain official geographic data for the first region. Based on this request, the official geographic information system of the first region sends the official geographic data of the first region to the electronic device. It should be noted that the official geographic data of the first region may include the first language names of some locations in the first region.

[0109] In one possible implementation of this application embodiment, the electronic device obtains official geographic data of the first region from publicly available data of the official location information system of the first region based on the first language names of various locations in the first region. Specifically, for location 1 among the obtained locations in the first region, the first language name of location 1 is included in a query request and sent to the official geographic information system of the first region. This query request is used to request a query for a second language name including location 1. Based on this query request, the official geographic information system of the first region queries its own database for the second language name of location 1 based on the first language name of location 1. If the second language name of location 1 is found, it sends the second language name of location 1 to the electronic device. If the official geographic information system of the first region does not find the second language name of location 1 in its own database based on the query request, it returns an indication that the name was not found to the electronic device. Referring to the above method, for each location in the first region, the electronic device executes the above method to obtain the official geographic data of the first region.

[0110] In one possible implementation of this application embodiment, the electronic device obtains official geographic data of the first region from publicly available data of the official location information system of the first region based on the first language names of various locations in the first region. Specifically, the electronic device sends a query request to the official geographic information system of the first region, requesting a query for the overall official geographic data of the first region. Based on this query request, the official geographic information system of the first region queries its own database for all relevant official geographic data of the first region, and then sends the queried official geographic data of the first region to the electronic device. Next, based on the first language names of various locations in the first region obtained above, the electronic device filters all relevant official geographic data of the first region sent by the official geographic information system of the first region, selecting official geographic data that includes both the first language names and the second language names of the locations in the first region, thereby obtaining the official geographic data of the first region.

[0111] In some embodiments, the electronic device stores the official geographic data files of the first region collected by the official geographic information system in a directory. If the directory does not exist, the electronic device automatically creates it to ensure that the official geographic data of the first region can be correctly saved and managed.

[0112] In some embodiments, if the data returned by the official geographic information system of the first region is in XML format, then in this embodiment, when the electronic device obtains official geographic data of the first region from the official geographic information system of the first region, it needs to verify the format of the data sent by the official geographic information system of the first region to ensure that it is in XML format, thereby ensuring the structural integrity and consistency of the data. It should be noted that the XML format here is only an example, and the specific format is determined by the specific format of the data returned by the official geographic information system of the first region. For example, if the data returned by the official geographic information system of the first region is in a preset format A, then when the electronic device receives the returned official geographic data of the first region from the official geographic information system of the first region, it checks whether the format of the received data is format A. If it is format A, it receives the data. If the received data is not in format A, it indicates that an error occurred in the data transmission or that the data being transmitted is not official geographic data of the first region. The electronic device deletes the data whose format is not A to ensure the structural integrity and consistency of the received data.

[0113] In some embodiments, this application implements an intelligent request mechanism. For each location or organization name, the electronic device initiates a query request to the public API of the official geographic information system of the first region. If the first request fails, a retry is performed. Optionally, a retry strategy of up to n times (e.g., three times) is implemented for communication failures to ensure a high success rate of data acquisition.

[0114] In some embodiments, anomaly detection is deployed throughout the entire data acquisition cycle of this step to capture and record any potential network anomalies in real time. That is, if any network request anomaly is encountered during the data acquisition process of this step, error information will be recorded and retrying will be performed until a preset number of attempts is reached. All operations and anomalies are recorded in detail in a log file for easy review and troubleshooting.

[0115] In this embodiment of the application, the electronic device obtains the official geographic data of the first region from the public data of the official location information system of the first region based on the first language names of various locations in the first region, and then performs the following step S103.

[0116] S103. Based on the official geographic data of the first region, extract the correspondence between the first language names and the second language names of N locations in the first region, and construct the first dictionary for the first region.

[0117] Based on the above steps, the electronic device acquires official geographic data for the first region and then integrates this data. This official geographic data includes the first-language names and second-language names of N locations within the first region. The electronic device then extracts the first-language names and second-language names of the N locations within the first region from the official geographic data, constructing a first dictionary for the first region.

[0118] For example, the first dictionary of the first region is shown in Table 2:

[0119] Table 2

[0120]

[0121]

[0122] As shown in Table 2, this embodiment of the application can obtain official geographic data of the first region from publicly available data in the official location information system of the first region, and then construct a first dictionary for the first region based on the official geographic data of the first region. This first dictionary includes at least some locations in the first region, such as the correspondence between the first language names and second language names of N locations. That is, the format of the first dictionary is: Chinese\tEnglish, for example: Baoan Building\tEdf.Pou On, Defeng Building\tTak Fung House.

[0123] Since this first dictionary is built based on official geographical data of the first region, it is highly accurate. Therefore, in subsequent place name translation, it can be queried in this first dictionary, or the first dictionary can be used to train the place name translation model, so that the trained place name translation model can accurately translate the second language names of different places in the first region.

[0124] S104. Based on the first language names of various locations in the first region, search the map data of the first region to obtain the list data corresponding to multiple locations in the first region.

[0125] The list data includes, at least, the location and its surrounding neighboring locations in different languages.

[0126] It should be noted that the specific order of constructing the first dictionary and the second dictionary is not limited in the embodiments of this application. In one embodiment, the electronic device may construct the first dictionary first and then construct the second dictionary. In this case, the electronic device first executes steps S102 and S103, and then executes step S104. In some embodiments, the electronic device may construct the second dictionary first and then construct the first dictionary. In this case, the electronic device may first execute steps S104 and S105, and then execute steps S102 and S103. In some embodiments, the electronic device may construct the first dictionary and the second dictionary simultaneously. In this case, the electronic device may execute steps S104 and S105 in parallel while executing steps S102 and S103. The embodiments of this application do not impose any limitations on this, and the specific order is determined according to actual needs.

[0127] In other words, in some embodiments, the construction of the second dictionary and the first dictionary do not interfere with each other; that is, in the embodiments of this application, the electronic device does not consider the first dictionary when constructing the second dictionary. The two dictionaries are constructed separately.

[0128] In some embodiments, whether to construct a second dictionary is determined by the first dictionary. For example, in step S101 above, the electronic device obtains the first language names of P locations in the first region. If the first dictionary constructed by the electronic device based on the above steps includes the first and second language names of each of the P locations, i.e., N equals P, then the electronic device does not need to construct a second dictionary. If the first dictionary constructed by the electronic device based on the above steps includes the first and second language names of each of the N locations, and N is less than P, then the electronic device constructs a second dictionary. In other words, if the constructed first dictionary includes the second language names of all locations in the first region, then the electronic device does not need to construct a second dictionary. If the constructed first dictionary only includes the second language names of some locations in the first region, then the electronic device constructs a second dictionary.

[0129] In an embodiment of the present application, when the electronic device determines that a second dictionary needs to be constructed, based on the first language names of each location in the above-obtained first region, it searches in the map data of the first region to obtain list data corresponding to multiple locations in the first region respectively.

[0130] The embodiments of the present application do not limit the specific manner in which the electronic device searches in the map data of the first region based on the first language names of each location in the first region obtained above to obtain list data corresponding to multiple locations in the first region respectively.

[0131] In some embodiments, for each location in the first region, for example, the i-th location in the first region, the electronic device obtains, based on the first language name of the i-th location, in the map data of the first region, the i-th location and the multiple language names of each location within a preset radius of the i-th location, to obtain the list data corresponding to the i-th location.

[0132] Exemplarily, assuming that the first language name of the i-th location is "Mall A", the electronic device queries in the map data of the first region based on the first language name of the i-th location. For example, the electronic device carries the first language name of the i-th location in a query request and sends it to the API of the map system of the first region to query the second language name of the i-th location. The data returned by the map system of the first region is as follows:

[0133] [<Place name="Mall A",lat=22.3277551,lng=114.<1641259>,<Place name="商场B",lat=22.3259163,lng=114.166496>,<Place name="Fa Yuen Piece GoodsStore",lat=22.3259632,lng=114.<1664362>,<Place name="店面C",lat=22.327521,lng=114.<1630424>,<Place name="店面C",lat=22.3258277,lng=114.<1666092>,<Place name="店面D",lat=22.3286509,lng=114.<1632834>].

[0134] Among them, lat represents latitude and lng represents longitude.

[0135] Exemplarily, assume that the first - language name of the \(i\) - th location is "Mall A". Based on the first - language name of the \(i\) - th location, the electronic device queries in the map data of the first region. For example, the electronic device carries the first - language name of the \(i\) - th location in the query request and sends it to the API of the map system in the first region to query the second - language name of the \(i\) - th location. The data returned by the map system in the first region is as follows:

[0136] [<Place name="Mall A",lat=22.4849159,lng=114.<1448837>,<Place name="商场A",lat=22.2853877,lng=114.<1555126>]。

[0137] As can be seen from the above, the list data corresponding to the \(i\) - th location returned by the map system in the first region includes the \(i\) - th location and the multi - language names of each location within the preset radius range of the \(i\) - th location. Optionally, it also includes the location information of the \(i\) - th location and adjacent locations.

[0138] It should be noted that in the embodiments of the present application, for the \(i\) - th location in the first region, if the map system in the first region does not query the \(i\) - th location in the map data of the first region, an indication information of not being queried is returned.

[0139] In some embodiments, the list data corresponding to the above - mentioned \(i\) - th location may include the second - language name of the \(i\) - th location, or may not include the second - language name of the \(i\) - th location.

[0140] In some embodiments, the embodiments of the present application provide a retry mechanism for map retrieval operations to ensure that information can still be successfully obtained in the case of network jitter or limited query quotas. For example, when encountering quota restrictions, the electronic device can automatically wait for a period of time and then retry, maximizing the reliability of information retrieval.

[0141] In some embodiments, the electronic device combines the location search results of the map data with the processed data files to achieve data integration and optimization. After the new query results are cross - compared with the existing data, it is ensured that the retrieved locations are not processed repeatedly to optimize the data acquisition efficiency.

[0142] In some embodiments, the electronic device records each query operation in detail in a log file, including requests, responses, and exception situations, which is convenient for problem troubleshooting and system optimization.

[0143] In some embodiments, in the embodiments of the present application, it can also be detected and displayed in real - time in the form of a progress bar, enabling an intuitive understanding of the status of file processing and ensuring the transparency and traceability of the data collection task.

[0144] In some embodiments, the electronic device also supports parallel operation, allowing the simultaneous acquisition of list data corresponding to multiple locations in the first region, significantly improving data processing speed.

[0145] S105. Based on the list data corresponding to multiple locations, extract the correspondence between the first language name and the second language name of the M locations in the first region, and construct the second dictionary for the first region.

[0146] As described above, the electronic device searches the map data of the first region for a list of locations in the first region, based on the first language names of each location. This list includes at least the different language names of the location and its neighboring locations. Next, based on the list data corresponding to the multiple locations, the electronic device extracts the correspondence between the first and second language names of M locations in the first region, constructing a second dictionary for the first region.

[0147] For example, the second dictionary for the first region is shown in Table 3:

[0148] Table 3

[0149] Different locations First language names of the locations Second language names of the locations Location 21 First language name 21 First language name 21 Location 22 First language name 22 First language name 22 …… …… …… Location 2M First language name 2M First language name 2M

[0150] As shown in Table 3, this embodiment of the application can search for list data corresponding to multiple locations in the first region from the map data of the first region, and then construct a second dictionary for the first region based on the list data corresponding to the multiple locations. The second dictionary includes at least some locations in the first region, such as the correspondence between the first language names and the second language names of M locations.

[0151] S106. Obtain the pre-trained language model.

[0152] The pre-trained language model in this application, trained using deep learning and large amounts of data, has achieved superior language understanding and generation capabilities. This pre-trained language model has been specifically tuned to adapt to the linguistic environment and translation needs of the first region.

[0153] This application does not limit the specific type of the pre-trained language model; it can be any model with strong language understanding capabilities.

[0154] In one example, the pre-trained language model mentioned above can be a mixed-model language model, GPT-4, or other language models.

[0155] S107. Using at least one of the first and second dictionaries, fine-tune the pre-trained language model to obtain the place name translation model.

[0156] In order to reduce the training difficulty of the model, this embodiment of the application does not train the place name translation model from scratch, but rather... Figure 3 As shown, the pre-trained language model is fine-tuned using at least one of a first dictionary and a second dictionary to adapt it to the linguistic environment and translation needs of the first region. For ease of description, the fine-tuned language model is referred to as a place name translation model in this embodiment.

[0157] In some embodiments, in order to adapt the pre-trained language model to the linguistic environment of the first region and to accurately translate the place names in the first region, then as follows: Figure 4 As shown, the pre-trained language model is fine-tuned through the following steps to obtain the place name translation model:

[0158] S107-A. Based on the place name translation characteristics of the first region, a translation prompt template for the first region is constructed. The translation prompt template is used to indicate the translation of the first language name of a place in the first region into the second language name.

[0159] S107-B. Based on the translation prompt template, process the data included in at least one of the first dictionary and the second dictionary to obtain multiple prompt examples, which include the first language name and the second language name of the location in the first region;

[0160] S107-C: Using multiple prompt examples, fine-tune the pre-trained language model to obtain a place name translation model.

[0161] In this implementation, a translation prompt template (Prompt) for the first region is constructed based on the place name translation characteristics of the first region. This translation prompt template is used to instruct the translation of the first language names of places in the first region into second language names.

[0162] For example, the translation prompt template for the first region can be: translate the first language name of the location into the second language name of the location.

[0163] In this way, the electronic device can process the data included in at least one of the first and second dictionaries based on the translation prompt template of the first region, and obtain multiple prompt examples.

[0164] For example, the generated prompt example 1 is: Translate the first language name 1 of location 1 into the second language name 1. Another example, the generated prompt example 2 is: Translate the first language name 2 of location 2 into the second language name 2.

[0165] Next, the electronic device uses the generated prompt examples to fine-tune the pre-trained language model, resulting in a fine-tuned language model. This fine-tuned language model has the ability to translate place names in the first region, and therefore is denoted as the place name translation model.

[0166] In other words, this embodiment of the application can generate multiple prompt examples based on at least one of a first dictionary and a second dictionary using a few-shot learning prompt design approach. These prompt examples are then used to fine-tune the pre-trained language model, resulting in a place name translation model. This model quickly adapts to the unique pinyin system and place name translation rules of the first region using only a small number of examples. This significantly reduces the number of training samples required while improving the model's adaptability and flexibility. In other words, by using prompts designed with a few-shot learning strategy to fine-tune the pre-trained language model, this embodiment of the application not only improves the ability to capture regional characteristics but also enhances the model's flexibility and scalability. It can efficiently cope with the constantly changing linguistic environment and translation needs of the first region, significantly improving the performance and reliability of the entire translation process, and significantly reducing manual intervention, thereby enhancing the system's intelligence and operational efficiency.

[0167] The embodiments of this application can also flexibly adjust the language model and Prompt design according to different needs, which has a high degree of flexibility and scalability.

[0168] In some embodiments, the first and second dictionaries described above can be updated, for example, every certain period of time. In some embodiments, when the first and second dictionaries are updated, the electronic device can use at least one of the updated first and second dictionaries to fine-tune the place name translation model.

[0169] The above describes the construction process of the first and second dictionaries in the embodiments of this application, as well as the specific process of fine-tuning the pre-trained language model using at least one of the first and second dictionaries to obtain the place name translation model. The process of translating place names using the first and second dictionaries and the place name translation model is described below.

[0170] The above provides an overall overview of the place name translation process according to embodiments of this application. The following section will combine... Figure 5 The method for translating place names provided in the embodiments of this application will be further described.

[0171] Figure 5This is a flowchart illustrating a place name translation method provided in one embodiment of this application. The executing entity in this embodiment is a device with place name translation functionality, such as a place name translation apparatus. In some embodiments, the executing entity in this embodiment may be... Figure 1 The server in, or for Figure 1 Terminal devices in, or for Figure 1 The system consists of a server and terminal devices. For ease of description, this application uses an electronic device as an example for illustration.

[0172] like Figure 5 As shown, the place name translation method of this application embodiment includes the following steps:

[0173] S201. Obtain the first language name of the target location in the first region, and load at least one of the first dictionary and the second dictionary.

[0174] The first dictionary includes the correspondence between the first and second language names of N locations in the first region, determined based on official geographic data of the first region. The second dictionary includes the correspondence between the first and second language names of M locations in the first region, determined based on map data of the first region. N and M are both positive integers.

[0175] The embodiments of this application are not only applicable to Chinese-English translation, but can also be extended to other language pairs, as well as multiple fields such as science and technology, finance, and medicine, demonstrating good versatility and adaptability.

[0176] The place name translation method of this application embodiment is mainly used for accurate, efficient and automated translation of place names in the first region.

[0177] In one example, the method of this application embodiment can be applied to a map application for accurate translation of place names in a first region of a map.

[0178] In some embodiments, the terminal device of this application includes a place name translation application, which may be a map application or a search application, etc. The user can trigger the place name translation application to cause the terminal device to display, for example... Figure 6 The image shows a place name translation input interface. Users can enter the first language name of the target location to be translated in this interface. For example, as shown... Figure 6 As shown, the place name translation input interface includes an input box for the location to be translated. The user can enter the first language name of the target location in this input box, such as the Chinese name of the target location.

[0179] In this embodiment of the application, the specific implementation of S201 above includes at least the following possibilities:

[0180] In one example, if the place name translation in this embodiment is performed by a terminal device, the object inputs the first language name of the target location to be translated on the terminal device. If the terminal device does not have a first dictionary and a second dictionary stored locally, the terminal device, in response to the first language name of the target location input by the object, sends a request to the server to request the first dictionary and the second dictionary, and then loads at least one of the first dictionary and the second dictionary into its local storage.

[0181] In one example, if the place name translation in this embodiment is performed by a server, the user inputs the first language name of the target location to be translated on a terminal device. The terminal device sends the first language name of the target location input by the user to the server. In response to the first language name of the target location sent by the terminal device, the server loads at least one of a first dictionary and a second dictionary.

[0182] In some embodiments, after the electronic device obtains the first language name of the target location, it also preprocesses the first language name of the target location, such as removing special symbols or a large number of numbers, to determine that the place name information to be translated is valid place name information, thereby ensuring the cleanliness of the data.

[0183] S202. Based on at least one of the first dictionary, the second dictionary, and the place name translation model, translate the first language name of the target location to obtain the second language name of the target location.

[0184] The place name translation model was obtained by fine-tuning at least one of the first and second dictionaries.

[0185] In this embodiment of the application, during place name translation, the electronic device obtains the first language name of the target location and loads at least one of a first dictionary and a second dictionary. Based on at least one of the first dictionary, the second dictionary, and the place name translation model, the first language name of the target location is translated to obtain the second language name of the target location. It should be noted that if the place name translation method of this embodiment of the application is executed by a terminal device, the terminal device can obtain the trained place name translation model from the server.

[0186] As described above, the first dictionary in this embodiment is obtained based on official geographic data of the first region and includes relatively accurate second language names of N locations in the first region. The second dictionary is obtained based on map data of the first region and can include the second language names of more complete locations in the first region. Furthermore, this embodiment also uses the first and second dictionaries to train a language model, obtaining a place name translation model that can accurately translate place names in the first region. Thus, when an electronic device translates the first language name of a target location based on at least one of the first dictionary, the second dictionary, and the place name translation model, it can obtain the accurate second language name of the target location, thereby improving the accuracy of place name translation in the first region.

[0187] This application embodiment describes an electronic device translating the first language name of a target location based on at least one of a first dictionary, a second dictionary, and a place name translation model, without limiting the specific method by which the second language name of the target location is obtained.

[0188] In some embodiments, the electronic device determines the second language name of a target location using a first dictionary, a second dictionary, and a place name translation model, respectively. For example, the electronic device queries the first dictionary for the second language name of the target location based on its first language name, queries the second dictionary for the second language name of the target location based on its first language name, and translates the first language name of the target location using the place name translation model to obtain the second language name of the target location. Figure 7 As shown, the electronic device can obtain the second language name of the target location through three methods, and then obtain the final second language name of the target location based on the translation results of these three methods. For example, the second language name with the highest repetition rate among the translation results obtained from these three methods is determined as the final second language name of the target location. Another example: if the second language names obtained from the above three methods are all different, then the second language name obtained from the first dictionary query is determined as the final second language name of the target location. Yet another example: if the second language name of the target location is not found in the first dictionary among the above three methods, and the second language name of the target location found in the second dictionary is inconsistent with the second language name translated by the model, then the second language name translated by the model is taken as the final second language name of the target location, or the second language name obtained from the second dictionary query is compared with the second language name translated by the model, and the second language name that conforms to the pinyin system of the first region is selected as the final second language name of the target location. For example, if the second language name obtained from the second dictionary query is Chinese pinyin, and the second language name translated by the model is Cantonese pinyin, then the second language name translated by the model is determined as the final second language name of the target location.

[0189] In some embodiments, S202 above includes the following steps S202-A and S202-B:

[0190] S202-A: Based on the first language name of the target location, query the second language name of the target location in at least one of the first and second dictionaries;

[0191] S202-B: If the second language name of the target location is not found in either the first or second dictionary, the first language name of the target location is translated using a place name translation model to obtain the second language name of the target location.

[0192] In this embodiment of the application, the electronic device first queries the second language name of the target location in at least one of the first dictionary and the second dictionary.

[0193] In this embodiment of the application, the electronic device queries the second language name of the target location based on the first language name of the target location in at least one of a first dictionary and a second dictionary, including at least the following examples:

[0194] Example 1, such as Figure 8 As shown, the electronic device first searches for the second language name of the target location based on its first language name in a first dictionary, within the mapping of first and second language names of N locations. If the second language name of the target location is found in the first dictionary, it is determined as the final second language name of the target location, and no further searches are performed. If the second language name of the target location is not found in the first dictionary, the electronic device then searches for at least one language name of the target location within the mapping of first and second language names of M locations in the second dictionary.

[0195] Example 2: The electronic device simultaneously queries the second language name of the target location in both a first dictionary and a second dictionary. If the second language name of the target location is not found in the other dictionary but is found in the other, then that found second language name is determined as the final second language name of the target location, and no further model translation is performed. If the second language name of the target location is found in both dictionaries, but the found second language names are inconsistent, then the second language name found in the first dictionary is taken as the final second language name of the target location. Alternatively, the second language name that conforms to the pinyin rules of the first region among the two found second language names is determined as the final second language name of the target location.

[0196] In this embodiment of the application, if the second language name of the target location is not found in either the first dictionary or the second dictionary, the first language name of the target location is translated using a place name translation model to obtain the second language name of the target location.

[0197] In some embodiments, before translating the first language name of a target location using a place name translation model to obtain the second language name of the target location, the electronic device acquires list data corresponding to multiple locations in a first region. This list data includes at least the different language names of the target location and its surrounding neighboring locations. Next, based on the first language name of the target location, the electronic device queries the list data corresponding to each of the multiple locations included in the map location data for the second language name of the target location. Specifically, if the electronic device determines that the target location is included among the multiple locations based on the first language name of the target location, it acquires the list data corresponding to that target location and then identifies the first second language name in the list data as the second language name of the target location. This is because for each location in the first region, the multiple language names of that location are arranged first in the list data obtained from the map data, followed by the multiple language names of its surrounding neighboring locations. For example, the multiple language names of the surrounding neighboring locations are sorted according to their distance from the location, from closest to furthest. In this way, when querying, the first second language name in the list data corresponding to the location can be identified as the second language name of the location.

[0198] If an electronic device cannot find the second language name of a target location in the list data corresponding to multiple locations, it will use a place name translation model to translate the first language name of the target location to obtain the second language name of the target location.

[0199] As described above, by using the first and second dictionaries to cross-match the second language names of the target locations, preliminary place name identification and calibration are achieved, significantly improving translation accuracy. Furthermore, the system employs a large-scale language model to conduct in-depth semantic analysis and cultural adaptation calibration on unmatched place names. This step handles complex linguistic phenomena and cultural differences, ensuring the natural fluency and cultural compatibility of the translation results. Finally, the translation results output by the model are reprocessed to optimize their accuracy and coherence, conforming to the specific linguistic environment of the first region.

[0200] In some embodiments, the place name translation logic can be implemented by defining a function. For example, the function takes a list of received input files, the path to the first dictionary, the path to the second dictionary, the output file path, and the output path for any unfound place names as parameters. Internally, the function first loads the first and second dictionaries based on their paths, then opens each input file sequentially and parses and translates each line of data. For each valid place name in its first language (e.g., a Chinese place name), it attempts to obtain the corresponding translation result (i.e., obtain the second language name) from the first and second dictionaries, as well as the place name translation model. If the translation is successful, the place name and its translation result will be written to the output file; if the translation fails, the original place name data will be recorded in the file containing the unfound place names for subsequent analysis and processing.

[0201] In some embodiments of this application, the second language name of the target location can also be saved locally for subsequent use and analysis. For example, during the next place name translation, the electronic device can first query whether the locally stored translation results include the result for the next place name translation. If so, the result is returned directly; otherwise, the place name translation method of this application is executed to perform the place name translation. Optionally, this data can be used by other translation systems or navigation systems.

[0202] In some embodiments, at least one of the first and second dictionaries can be updated based on the second language name of the target location. For example, if the electronic device does not find the second language name of the target location in either the first or second dictionary, it can add the translated second language name of the target location to both dictionaries. Alternatively, if the electronic device finds the second language name of the target location in the first dictionary but not in the second dictionary, it adds the second language name found in the first dictionary to the second dictionary. And again, if the electronic device finds the second language name of the target location in the second dictionary but not in the first dictionary, it adds the second language name found in the second dictionary to the first dictionary.

[0203] The place name translation method provided in this application first constructs a first dictionary based on official geographic data of a first region. This first dictionary includes the correspondence between the first and second language names of N locations in the first region. Then, based on map data of the first region, a second dictionary is constructed, including the correspondence between the first and second language names of M locations in the first region. At least one of the first and second dictionaries is used to fine-tune the place name translation model, ensuring accurate translation of place names in the first region. During place name translation, the first language name of the target location in the first region is obtained, and at least one of the first and second dictionaries is loaded. Then, based on the first and second dictionaries and at least one of the fine-tuned place name translation model, the first language name of the target location is translated to obtain the second language name of the target location. In other words, this application embodiment ensures the accuracy and consistency of place name translation in the first region by integrating official geographic data and map data and employing a multi-layered translation calibration process.

[0204] The foregoing provides an overall overview of the place name translation method provided in the embodiments of this application. The following section uses the interaction between a terminal device and a server as an example to further illustrate the place name translation method of this application.

[0205] Figure 9 This is a flowchart illustrating a place name translation method provided in an embodiment of this application.

[0206] like Figure 9 As shown, the place name translation method of this application embodiment includes the following steps:

[0207] S301, The terminal device displays the place name translation input interface.

[0208] The terminal device in this application embodiment is equipped with a translation application, which allows the user to translate place names.

[0209] In one example, such as Figure 10 As shown, the object triggers the client icon of the place name translation application installed on the terminal device, and the terminal device responds to the trigger operation by displaying the place name translation input interface.

[0210] In one example, such as Figure 11A As shown, the object triggers the client icon of the place name translation application installed on the terminal device. In response to this triggering operation, the terminal device displays a translation function selection interface. This translation function selection interface includes at least one of the following: place name translation option, pinyin detection option, pinyin replacement option, and automatic translation option.

[0211] The options include: a place name translation option to instruct the use of the place name translation method described in the embodiments of this application, i.e., place name translation based on a first dictionary, a second dictionary, and a place name translation model; a pinyin detection option to perform pinyin detection on the second language name of the location input by the object; a pinyin replacement option to perform pinyin detection on the second language name of the location input by the object, and to replace the pinyin with pinyin specific to the first region when the detected pinyin is not specific to the first region; and an automatic translation option to perform place name translation using the place name translation model.

[0212] like Figure 11B As shown, if an object needs to use the first dictionary, the second dictionary, and the place name translation model of this application embodiment to translate place names, the place name translation option is triggered, and the terminal device responds to the object's triggering operation of the place name translation option by displaying the place name translation input interface.

[0213] S302. The terminal device receives the first language name of the target location in the first region entered by the target in the place name translation input interface.

[0214] For example, such as Figure 12 As shown, the place name translation input interface includes a place name input box to be translated. The object can enter the first language name of the target location in the place name input box, such as the Chinese name of the target location.

[0215] In some embodiments of this application, the terminal device executes the place name translation method of this application. At this time, the terminal device can add at least one of a first dictionary and a second dictionary to the first language name of the target location based on the object input, and translate the first language name of the target location based on at least one of the first dictionary, the second dictionary and the place name translation model to obtain the second language name of the target location. The specific process is described in the above embodiments.

[0216] In some embodiments of this application, the server executes the place name translation method of this application. At this time, after the terminal device receives the first language name of the target location input by the object, it executes the following step S303.

[0217] S303, The terminal device sends the first request to the server.

[0218] The first request includes the first language name of the target location.

[0219] In this embodiment, such as Figure 11B As shown, the object triggers the place name translation option, allowing the terminal device to send the first request to the server by calling the API corresponding to the place name translation option. In this case, the first request is used to request the translation of the target location's first language name into its second language name.

[0220] S304. The server translates the first language name of the target location based on at least one of the first dictionary, the second dictionary, and the place name translation model to obtain the second language name of the target location.

[0221] In this embodiment, when the server receives a first request from the terminal device, it parses the first request to obtain the first language name of the target location. If the first request is to request the translation of the first language name of the target location into a second language name, the server queries the second language name of the target location in at least one of a first dictionary and a second dictionary based on the first language name of the target location. If the second language name of the target location is not found in either the first dictionary or the second dictionary, the server translates the first language name of the target location using a place name translation model to obtain the second language name of the target location.

[0222] The specific implementation process of S304 can be referred to the specific description of S202 above, and will not be repeated here.

[0223] S305. The server sends the second language name of the target location to the terminal device.

[0224] S306. The terminal device displays the second language name of the target location.

[0225] For example, such as Figure 12 The place name translation input interface shown may also include a place name translation result display box. The terminal device can display the second language name of the target location sent by the server in this display box.

[0226] In some embodiments, such as Figure 11A As shown in the embodiments of this application, other options are also provided, and the user can choose according to their actual needs.

[0227] In one embodiment, two interfaces can be provided: a first dictionary lookup and a second dictionary lookup. Optionally, the first request can be a GET request. Optionally, the input data includes a query parameter `query`, and the server returns the second language name of the target location. The output data is in JSON format, containing a status and content.

[0228] For example, the input and output for the first dictionary query interface ( / query / gm) are shown below:

[0229] Input: "Area A"

[0230] curl http: / / 0.0.0.0:8081 / query / gm?query=regionA

[0231] Output: {"status":True,"content":"quyuA"}

[0232] For example, the input and output for the second dictionary query interface ( / query / gov) are shown below:

[0233] Input: Region B

[0234] curl http: / / localhost:8081 / query / gov? query=area B

[0235] Output: {"status":True,"content":"quyuB"}.

[0236] In some embodiments of this application, if an object needs to perform Chinese pinyin detection on its place name translation results, then as follows: Figure 13A As shown, the object triggers the pinyin detection option. In response to the object's triggering of this pinyin detection option, the terminal device displays a pinyin detection input interface. The object can enter the first language name and the translated name of the target location in this pinyin detection input interface. Next, the object triggers the confirm option. In response to the object's triggering of this confirm option, the terminal device sends a first request to the server. This first request includes the first language name and the translated name of the target location entered by the object, and this first request is used to request a determination of whether the translated name is Chinese pinyin.

[0237] In one possible implementation of this embodiment, the terminal device sends a first request to the server via the API corresponding to the pinyin detection option. Optionally, when generating the first request, the terminal device processes the input text by adding spaces on both sides of each punctuation mark in the text using a predefined list of punctuation marks to ensure correct word recognition and processing in subsequent steps. Furthermore, the terminal device removes redundant spaces and leading / ending whitespace characters from the text, ensuring a standardized representation of the text. This generates a first request that meets the requirements.

[0238] The server receives a first request sent by a terminal device, analyzes the first request to obtain the first language name of the target location and the translated name of the target location, and analyzes that the first request is used to request to determine whether the translated name is Chinese pinyin. Then, perform a Chinese pinyin detection on the translated name to obtain the Chinese pinyin detection result of the translated name. For example, the server obtains the Chinese pinyin of the target location based on the first language name of the target location, compares the Chinese pinyin with the translated name. If they are the same, it is determined that the translated name is Chinese pinyin. If they are not the same, it is determined that the translated name is not Chinese pinyin. Then, the server sends the Chinese pinyin detection result of the translated name to the terminal device, and the terminal device displays the Chinese pinyin detection result of the translated name.

[0239] Exemplarily, such as Figure 13B The shown pinyin detection input interface may further include a display box for the Chinese pinyin detection result of the translated name. The terminal device can display the Chinese pinyin detection result of the translated name sent by the server in this display box.

[0240] Optionally, the input data includes name and trans fields. The output can be in JSON format, including a flag has_pinyin indicating whether pinyin is detected.

[0241] Optionally, in this example, the above first request can be GET and POST requests.

[0242] Exemplarily, the input and output of this embodiment are as follows:

[0243] Input: {"name":"Zhonghuan","trans":"Zhong Huan"}

[0244] Output: {"has_pinyin":true}

[0245] Optionally, the above output can be in JSON format.

[0246] Based on this embodiment, an object can detect its own place name translation result to determine whether its own place name translation result is correct.

[0247] In some embodiments of the present application, if an object needs to perform a Chinese pinyin detection on its own place name translation result and needs to obtain the second language name of the target location, then such as Figure 14AAs shown, the object triggers the pinyin replacement option. In response to the object's triggering of this pinyin replacement option, the terminal device displays a pinyin detection and replacement input interface. The object can enter the first language name and the translated name of the target location in this pinyin detection and replacement input interface. Next, the object triggers the confirm option. In response to the object's triggering of this confirm option, the terminal device sends a first request to the server. This first request includes the first language name and the translated name of the target location entered by the object, and is used to request a determination of whether the translated name is Chinese pinyin, as well as to request the second language name of the target location.

[0248] In one possible implementation of this embodiment, the terminal device sends a first request to the server via the API corresponding to the pinyin replacement option.

[0249] The server receives a first request from the terminal device, parses the request to obtain the first language name and the translated name of the target location, and determines whether the translated name is in Chinese Pinyin. If the translated name is not in Chinese Pinyin, the server replaces it with the second language name. Specifically, the server parses the first request to obtain the translated name of the target location input by the user; it performs Chinese Pinyin detection on the translated name to obtain the Pinyin detection result; if the translated name input by the user is in Chinese Pinyin, it loads at least one of a first dictionary and a second dictionary, and translates the first language name of the target location based on at least one of the first dictionary, the second dictionary, and a place name translation model to obtain the second language name of the target location; the server then replaces the translated name input by the user with the second language name of the target location. For example, the server obtains the Chinese Pinyin of the target location based on its first language name, then compares the Pinyin with the translated name. If they match, the server determines that the translated name is in Chinese Pinyin. In this case, the server translates the first language name of the target location based on at least one of the first dictionary, the second dictionary, and a place name translation model to obtain the second language name of the target location. Then, the server sends the Chinese pinyin detection result of the translated name to the terminal device.

[0250] For example, such as Figure 14B The pinyin detection and replacement input interface shown may also include a translation result display box. The terminal device can display the second language name of the target location sent by the server in this display box.

[0251] Optionally, the input data includes the name and trans fields. The output can be in JSON format, containing the replacement flag (replace_flag) and the processed result (result).

[0252] Optionally, in this example, the above first request can be a GET or POST request.

[0253] Exemplarily, the input and output of this embodiment are as follows:

[0254] Input: {"name": "Zhonghuan", "trans": "Zhong Huan"}

[0255] Output: {"replace_flag": true, "result": "Chung Wan"}

[0256] Based on this embodiment, the object can detect its own place name translation result to determine whether its place name translation result is correct, and can obtain the accurate second language name of the target location.

[0257] Exemplarily, the terminal device and the server can implement the detection of whether the translation result is in Chinese pinyin, and perform Cantonese pinyin replacement when the translation result is in Chinese pinyin by executing the following code:

[0258] Table 4

[0259]

[0260]

[0261]

[0262]

[0263] In some embodiments of the present application, if the object needs automatic translation, then as Figure 15A shown, the object triggers the automatic translation option. The terminal device responds to the trigger operation of the object on this automatic translation option and displays an automatic translation input interface. The object can input the first language name of the target location in this automatic translation input interface. Then, the object triggers the confirmation option. The terminal device responds to the trigger operation of the object on this confirmation option and sends a first request to the server. At this time, the first request includes the first language name of the target location input by the object, and this first request is used to request to translate the second language name of the target location using a place name translation model.

[0264] Exemplarily, as Figure 15B shown, the automatic translation input interface can also include a translation result display box. The terminal device can display the second language name of the target location sent by the server in this display box.

[0265] In a possible implementation manner of this embodiment, the terminal device sends a first request to the server through the API corresponding to the automatic translation option.

[0266] In this implementation, a list of locations to be translated can also be input, that is, multiple locations to be translated can be entered at once in their first language, and the corresponding server can output the second language names of those multiple locations.

[0267] Optionally, the input data can be in JSON format, containing a text list field named text_list. The output can be in JSON format, containing a success flag "success" and the translation results "translations".

[0268] Optionally, in this example, the first request mentioned above can be a POST request.

[0269] Based on this embodiment, the object can use a place name translation model to automatically translate place names.

[0270] As described above, the different functions can be implemented through different APIs, and this embodiment supports automatic API re-calling. When the returned output is incorrect, the system will automatically re-call the API. This embodiment also supports parallel execution. This embodiment maintains high performance while minimizing API token consumption, ensuring economic efficiency and sustainability.

[0271] The place name translation method of this application, by combining the advantages of large-scale language models and multi-source data, not only improves the accuracy and efficiency of translation but also enhances the automation and intelligence of the system. Compared with traditional translation methods, this application embodiment can achieve accurate translation of place names in specific regions.

[0272] The above text combined Figures 2 to 15B The embodiments of the place name translation method of this application are described in detail below, in conjunction with... Figure 16 The following describes in detail the device embodiments of this application.

[0273] Figure 16 This is a schematic block diagram of a place name translation device provided in one embodiment of this application.

[0274] like Figure 16 As shown, the place name translation device 10 includes:

[0275] The acquisition unit 11 is used to acquire the first language name of the target location in the first region and load at least one of the first dictionary and the second dictionary. The first dictionary includes the correspondence between the first language name and the second language name of N locations in the first region determined based on the official geographic data of the first region. The second dictionary includes the correspondence between the first language name and the second language name of M locations in the first region determined based on the map data of the first region. N and M are both positive integers.

[0276] Translation unit 12 is used to translate the first language name of the target location using at least one of the first dictionary, the second dictionary, and the place name translation model to obtain the second language name of the target location. The place name translation model is obtained by fine-tuning a pre-trained language model using at least one of the first dictionary and the second dictionary.

[0277] In some embodiments, the translation unit 12 is specifically used to query the second language name of the target location in at least one of the first dictionary and the second dictionary based on the first language name of the target location; if the second language name of the target location is not found in either the first dictionary or the second dictionary, the first language name of the target location is translated using the place name translation model to obtain the second language name of the target location.

[0278] In some embodiments, the translation unit 12 is specifically configured to, based on the first language name of the target location, query the second language name of the target location in the correspondence between the first and second language names of N locations included in the first dictionary; if the second language name of the target location is not found in the first dictionary, query at least one language name of the target location in the correspondence between the first and second language names of M locations included in the second dictionary, based on the first language name of the target location.

[0279] In some embodiments, the translation unit 12 is specifically used to obtain list data corresponding to multiple locations in the first region, wherein the list data includes at least the different language names of the location and its surrounding neighboring locations; based on the first language name of the target location, query the second language name of the target location in the list data corresponding to each of the multiple locations; if the second language name of the target location is not found in the list data corresponding to each of the multiple locations, then the first language name of the target location is translated using the place name translation model to obtain the second language name of the target location.

[0280] In some embodiments, the translation unit 12 is specifically used to, based on the first language name of the target location, if it is determined that the target location is included among the plurality of locations, obtain the list data corresponding to the target location; and determine the first second language name in the location names in the list data corresponding to the target location as the second language name of the target location.

[0281] In some embodiments, the acquisition unit 11 is specifically used to acquire a first request sent by an object, the first request including a first language name of the target location; if the first request is used to request the translation of the first language name of the target location into a second language name, then at least one of the first dictionary and the second dictionary is loaded.

[0282] In some embodiments, the translation unit 12 is further configured to, if the first request includes the translated name of the target location input by the object, and the first request is used to request whether the translated name is Chinese Pinyin, then parse the first request to obtain the translated name of the target location input by the object; perform Chinese Pinyin detection on the translated name to obtain the Chinese Pinyin detection result of the translated name.

[0283] In some embodiments, the translation unit 12 is further configured to: parse the first request to obtain the translated name of the target location input by the object if the first request includes the translated name of the target location input by the object, and the first request is used to request whether the translated name is Chinese Pinyin and to request the second language name of the target location; perform Chinese Pinyin detection on the translated name to obtain the Chinese Pinyin detection result of the translated name; if the translated name input by the object is Chinese Pinyin, load at least one of the first dictionary and the second dictionary, and translate the first language name of the target location based on at least one of the first dictionary, the second dictionary and the place name translation model to obtain the second language name of the target location; and replace the translated name input by the object with the second language name of the target location.

[0284] In some embodiments, the translation unit 12 is further configured to translate the first language name of the target location using the location translation model to obtain the second language name of the target location if the first request is for requesting automatic translation of the second language name of the target location.

[0285] In some embodiments, the translation unit 12 is further configured to obtain the first language names of various locations in the first region; based on the first language names of various locations in the first region, obtain official geographic data of the first region from the public data of the official location information system of the first region; based on the official geographic data of the first region, extract the correspondence between the first language names and the second language names of N locations in the first region, and construct a first dictionary for the first region.

[0286] In some embodiments, the translation unit 12 is specifically used to search for list data corresponding to multiple locations in the first region from map data of the first region based on the first language names of various locations in the first region, wherein the list data includes at least the different language names of the location and its surrounding neighboring locations; and based on the list data corresponding to the multiple locations, to extract the correspondence between the first language names and the second language names of M locations in the first region, and to construct a second dictionary for the first region.

[0287] In some embodiments, the translation unit 12 is specifically used to, for the i-th location in the first region, obtain, based on the first language name of the i-th location, multiple language names of various locations within a preset radius of the i-th location from the map data of the first region, and obtain list data corresponding to the i-th location, where i is a positive integer.

[0288] In some embodiments, the translation unit 12 is further configured to obtain a pre-trained language model; and to fine-tune the pre-trained language model using at least one of the first dictionary and the second dictionary to obtain the place name translation model.

[0289] In some embodiments, the translation unit 12 is further configured to construct a translation prompt template for the first region based on the place name translation features of the first region, the translation prompt template being used to indicate that the first language name of a place in the first region is translated into a second language name; based on the translation prompt template, process the data included in at least one of the first dictionary and the second dictionary to obtain multiple prompt examples, the prompt examples including the first language name and the second language name of a place in the first region; and use the multiple prompt examples to fine-tune the pre-trained language model to obtain the place name translation model.

[0290] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 16 The apparatus shown can perform the embodiments of the above-described methods, and the foregoing and other operations and / or functions of each module in the apparatus are respectively for implementing the method embodiments corresponding to the electronic device. For the sake of brevity, they will not be described in detail here.

[0291] Figure 17 This is a schematic block diagram of a place name translation device provided in one embodiment of this application.

[0292] like Figure 17 As shown, the place name translation device 20 is applied to a terminal device and includes:

[0293] Interface display unit 21 is used to display the place name translation input interface;

[0294] Receiving unit 22 is used to receive the first language name of the target location in the first region input by the object in the place name translation input interface;

[0295] The translation display unit 23 is used to display the second language name of the target location; wherein the second language name of the target location is obtained by translating the first language name of the target location based on at least one of the first dictionary, the second dictionary, and the place name translation model. The first dictionary includes the correspondence between the first language names and the second language names of N locations in the first region determined based on official geographical data of the first region. The second dictionary includes the correspondence between the first language names and the second language names of M locations in the first region determined based on map data of the first region. N and M are both positive integers.

[0296] In some embodiments, the interface display unit 21 is further configured to display a translation function selection interface, which includes at least one of a place name translation option, a pinyin detection option, a pinyin replacement option, and an automatic translation option; and to display the place name translation input interface in response to the object's triggering operation on the place name translation option.

[0297] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, further details will not be provided here. Specifically, Figure 17 The apparatus shown can perform the embodiments of the above-described methods, and the foregoing and other operations and / or functions of each module in the apparatus are respectively for implementing the method embodiments corresponding to the electronic device. For the sake of brevity, they will not be described in detail here.

[0298] The apparatus of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.

[0299] Figure 18 This is a schematic block diagram of the electronic device provided in the embodiments of this application. Figure 18 The electronic device can be a terminal device or a server, and can be used to execute the above method embodiments.

[0300] like Figure 18 As shown, the electronic device 30 may include:

[0301] The system includes a memory 31 and a processor 32. The memory 31 stores a computer program 33 and transfers the program code 33 to the processor 32. In other words, the processor 32 can retrieve and run the computer program 33 from the memory 31 to implement the methods described in the embodiments of this application.

[0302] For example, the processor 32 can be used to execute the steps in the above method according to the instructions in the computer program 33.

[0303] In some embodiments of this application, the processor 32 may include, but is not limited to:

[0304] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0305] In some embodiments of this application, the memory 31 includes, but is not limited to:

[0306] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0307] In some embodiments of this application, the computer program 33 may be divided into one or more modules, which are stored in the memory 31 and executed by the processor 32 to complete the page recording method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program 33 in the electronic device.

[0308] like Figure 18 As shown, the electronic device 30 may further include:

[0309] Transceiver 34, which can be connected to processor 32 or memory 31.

[0310] The processor 32 can control the transceiver 34 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 34 may include a transmitter and a receiver. The transceiver 34 may further include antennas, and the number of antennas may be one or more.

[0311] It should be understood that the various components in the electronic device 30 are connected through a bus system, which includes a data bus, a power bus, a control bus, and a status signal bus.

[0312] According to one aspect of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.

[0313] According to another aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the above-described method embodiments.

[0314] In other words, when implemented using software, it can be implemented wholly or partially in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0315] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0316] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0317] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0318] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for translating place names, characterized in that, include: Obtain the first language name of the target location in the first region, and load at least one of the first dictionary and the second dictionary. The first dictionary includes the correspondence between the first language name and the second language name of N locations in the first region, determined based on the official geographic data of the first region. The second dictionary includes the correspondence between the first language name and the second language name of M locations in the first region, determined based on the map data of the first region. N and M are both positive integers. The first language name of the target location is translated using at least one of the first dictionary, the second dictionary, and the place name translation model to obtain the second language name of the target location. The place name translation model is obtained by fine-tuning a pre-trained language model using at least one of the first dictionary and the second dictionary.

2. The method according to claim 1, characterized in that, The step of translating the first language name of the target location into a second language name by using at least one of the first dictionary, the second dictionary, and a place name translation model includes: Based on the first language name of the target location, query the second language name of the target location in at least one of the first dictionary and the second dictionary; If the second language name of the target location is not found in either the first dictionary or the second dictionary, the first language name of the target location is translated using the place name translation model to obtain the second language name of the target location.

3. The method according to claim 2, characterized in that, The step of querying the second language name of the target location based on the first language name of the target location in at least one of the first dictionary and the second dictionary includes: Based on the first language name of the target location, the second language name of the target location is queried from the correspondence between the first and second language names of the N locations included in the first dictionary; If the second language name of the target location is not found in the first dictionary, based on the first language name of the target location, at least one language name of the target location is queried from the correspondence between the first and second language names of the M locations included in the second dictionary.

4. The method according to claim 3, characterized in that, Before translating the first language name of the target location using the place name translation model to obtain the second language name of the target location, the method further includes: Obtain list data corresponding to multiple locations in the first region, wherein the list data includes at least the different language names of the locations and their surrounding neighboring locations; Based on the first language name of the target location, query the second language name of the target location from the list data corresponding to each of the plurality of locations; The process of translating the first language name of the target location using the place name translation model to obtain the second language name of the target location includes: If the second language name of the target location is not found in the list data corresponding to the multiple locations, the first language name of the target location is translated using the place name translation model to obtain the second language name of the target location.

5. The method according to claim 4, characterized in that, The step of querying the second language name of the target location from the list data corresponding to each of the plurality of locations, based on the first language name of the target location, includes: Based on the first language name of the target location, if it is determined that the target location is included among the plurality of locations, then the list data corresponding to the target location is obtained; The first second language name in the list data corresponding to the target location is determined as the second language name of the target location.

6. The method according to claim 1, characterized in that, The step of obtaining the first language name of the target location in the first region and loading at least one of the first dictionary and the second dictionary includes: Obtain the first request sent by the object, the first request including the first language name of the target location; If the first request is for translating the first language name of the target location into a second language name, then at least one of the first dictionary and the second dictionary is loaded.

7. The method according to claim 6, characterized in that, The method further includes: If the first request includes the translated name of the target location input by the object, and the first request is used to request whether the translated name is Chinese Pinyin, then the first request is parsed to obtain the translated name of the target location input by the object; The translated name is subjected to Chinese Pinyin detection to obtain the Chinese Pinyin detection result of the translated name.

8. The method according to claim 6, characterized in that, The method further includes: If the first request includes the translated name of the target location input by the object, and the first request is used to request whether the translated name is Chinese Pinyin and to request the second language name of the target location, then the first request is parsed to obtain the translated name of the target location input by the object; The translated name is subjected to Chinese Pinyin detection to obtain the Chinese Pinyin detection result of the translated name; If the translated name input by the object is Chinese Pinyin, then at least one of the first dictionary and the second dictionary is loaded, and the first language name of the target location is translated based on at least one of the first dictionary, the second dictionary and the place name translation model to obtain the second language name of the target location; Replace the translated name entered by the object with the second language name of the target location.

9. The method according to claim 6, characterized in that, The method further includes: If the first request is used to request automatic translation of the second language name of the target location, then the first language name of the target location is translated using the location translation model to obtain the second language name of the target location.

10. The method according to claim 1, characterized in that, The method further includes: Obtain the first language names of all locations in the first region; Based on the first language names of various locations in the first region, official geographic data of the first region is obtained from the publicly available data of the official location information system of the first region. Based on the official geographic data of the first region, the correspondence between the first language names and the second language names of N locations in the first region is extracted, and a first dictionary for the first region is constructed.

11. The method according to claim 10, characterized in that, The method further includes: Based on the first language names of various locations in the first region, a list of multiple locations in the first region is obtained from the map data of the first region. The list data includes at least the different language names of the location and its surrounding neighboring locations. Based on the list data corresponding to the multiple locations, the correspondence between the first language name and the second language name of the M locations in the first region is extracted, and a second dictionary for the first region is constructed.

12. The method according to claim 11, characterized in that, The method of obtaining a list of multiple locations in the first region from the map data of the first region based on the first language names of various locations in the first region includes: For the i-th location in the first region, based on the first language name of the i-th location, obtain the i-th location and the multiple language names of various locations within a preset radius of the i-th location from the map data of the first region, and obtain the list data corresponding to the i-th location, where i is a positive integer.

13. The method according to claim 1, characterized in that, The method further includes: Obtain a pre-trained language model; The pre-trained language model is fine-tuned using at least one of the first dictionary and the second dictionary to obtain the place name translation model.

14. The method according to claim 13, characterized in that, The step of fine-tuning the pre-trained language model using at least one of the first dictionary and the second dictionary to obtain the place name translation model includes: Based on the place name translation characteristics of the first region, a translation prompt template for the first region is constructed. The translation prompt template is used to indicate the translation of the first language name of a place in the first region into a second language name. Based on the translation prompt template, the data included in at least one of the first dictionary and the second dictionary are processed to obtain multiple prompt examples, the prompt examples including the first language name and the second language name of the location in the first region; The pre-trained language model is fine-tuned using the multiple prompt examples to obtain the place name translation model.

15. A method for translating place names, characterized in that, Applied to a terminal device, the method includes: Display the place name translation input interface; The recipient enters the first language name of the target location in the first region in the place name translation input interface. Display the second language name of the target location; The second language name of the target location is obtained by translating the first language name of the target location based on at least one of a first dictionary, a second dictionary, and a place name translation model. The first dictionary includes the correspondence between the first language names and the second language names of N locations in the first region, determined based on official geographical data of the first region. The second dictionary includes the correspondence between the first language names and the second language names of M locations in the first region, determined based on map data of the first region. N and M are both positive integers.

16. The method according to claim 15, characterized in that, Before displaying the place name translation input interface, the method further includes: The translation function selection interface is displayed, which includes at least one of the following: place name translation option, pinyin detection option, pinyin replacement option, and automatic translation option; The display interface for translating place names includes: In response to the object's triggering operation on the place name translation option, the place name translation input interface is displayed.

17. A place name translation device, characterized in that, include: The acquisition unit is used to acquire the first language name of the target location in the first region and load at least one of the first dictionary and the second dictionary. The first dictionary includes the correspondence between the first language name and the second language name of N locations in the first region determined based on the official geographic data of the first region. The second dictionary includes the correspondence between the first language name and the second language name of M locations in the first region determined based on the map data of the first region. N and M are both positive integers. The translation unit is used to translate the first language name of the target location using at least one of the first dictionary, the second dictionary, and the place name translation model to obtain the second language name of the target location. The place name translation model is obtained by fine-tuning a pre-trained language model using at least one of the first dictionary and the second dictionary.

18. A place name translation device, characterized in that, Applied to terminal devices, including: The interface display unit is used to display the place name translation input interface; The receiving unit is used to receive the first language name of the target location in the first region, input by the object in the place name translation input interface; A translation display unit is used to display the second language name of the target location; wherein the second language name of the target location is obtained by translating the first language name of the target location based on at least one of a first dictionary, a second dictionary, and a place name translation model. The first dictionary includes the correspondence between the first language names and the second language names of N locations in the first region, determined based on official geographical data of the first region. The second dictionary includes the correspondence between the first language names and the second language names of M locations in the first region, determined based on map data of the first region. N and M are both positive integers.

19. An electronic device, comprising a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the computer program to implement the method as described in any one of claims 1 to 14 or 15 to 16.

20. A computer-readable storage medium, characterized in that, Used to store computer programs; The computer program causes the computer to perform the method as described in any one of claims 1 to 14 or 15 to 16.