Translation method, device and equipment
By receiving input and determining the source language, and using multiple translation methods to translate and synthesize the results separately, the problem of inaccurate translation is solved, and the accuracy and user experience of translation are improved.
Patent Information
- Application Number
- CN202411173715.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-17
AI Technical Summary
In existing translation techniques, the translation results are inaccurate, especially in multilingual environments, and it is difficult to accurately convert information from different languages.
By receiving input indicating to translate the target information, the source language of the target information is determined, and the target information is translated separately using multiple translation methods to obtain multiple translation results, and then the effective parts are synthesized to obtain the final translation results.
Improve the accuracy of translation, especially in multilingual environments, information can be converted more accurately and user real-time translation experience can be improved.
Smart Images

Figure CN119150888A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a translation method, device and equipment. Background Art
[0002] Translation is the act of converting information in one language into information in another language.
[0003] In the related art, in a translation, there is often a situation where the translation result is inaccurate. For example, the text to be translated is "I plan to go to Liao (Hakka: go to play) tomorrow (Cantonese: tomorrow), Lu Ai Mai (Teochew: do you want to) gotogether (English: together)". When it is translated into Mandarin, the translation result is "I plan to go to Liao Lu Ai Mai gotogether tomorrow"; or the translation result is "I plan to go to Liao Lu Ai Mai together" on the day of translation. It can be seen that the above two translation results are inaccurate. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a translation method, apparatus, device and medium to improve translation accuracy.
[0005] In a first aspect, an embodiment of the present application provides a translation method, comprising:
[0006] receiving a first input instructing to translate the target information;
[0007] In response to the first input, determining a source language corresponding to the target information;
[0008] In the case where the source language includes a first language and a second language, the target information is translated using a first translation method and a second translation method respectively to obtain a first translation result and a second translation result;
[0009] The first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain a third translation result.
[0010] In a second aspect, an embodiment of the present application provides a translation device, including:
[0011] A receiving module, configured to receive a first input indicating translation of target information;
[0012] A first determination module, configured to determine a source language corresponding to the target information in response to a first input;
[0013] A translation module, for translating the target information using a first translation method and a second translation method respectively, when the source language includes a first language and a second language, to obtain a first translation result and a second translation result;
[0014] The combining module is used to synthesize the first valid translation part in the first translation result and the second valid translation part in the second translation result to obtain a third translation result.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the translation method provided in the embodiment of the present application are implemented.
[0016] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the translation method provided in the embodiment of the present application are implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the steps of the translation method provided in the embodiment of the present application.
[0018] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the steps of the translation method provided in the embodiment of the present application.
[0019] In an embodiment of the present application, a first input indicating translation of target information is received; in response to the first input, a source language corresponding to the target information is determined; in the case where the source language includes the first language and the second language, the target information is translated using the first translation method and the second translation method respectively to obtain a first translation result and a second translation result; the first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain a third translation result. In this way, by translating the target information using the first translation method and the second translation method to obtain the first translation result and the second translation result, the first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain the final translation result, which can improve the accuracy of translation compared to related technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flowchart of the translation method provided in the embodiment of the present application;
[0021] Figure 2 This is a first schematic diagram of the translation process provided by the embodiment of the present application;
[0022] Figure 3 This is a second schematic diagram of the translation process provided in the embodiment of the present application;
[0023] Figure 4 is a schematic diagram of the structure of a translation device provided in an embodiment of the present application;
[0024] Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0025] Figure 6 It is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0028] The following is a detailed description of the translation method, device and equipment provided in the embodiments of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0029] The translation method and device provided in the embodiment of the present application can be applied to a first electronic device, which can be a terminal or other devices other than a terminal. Exemplarily, the first electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0030] Figure 1 : is a flowchart of a translation method provided in an embodiment of the present application. The translation method may include:
[0031] Step 101: receiving a first input indicating translation of target information;
[0032] In some possible implementations of the embodiments of the present application, the first input in the embodiments of the present application is used to trigger the translation of the target information. The first input in the embodiments of the present application includes but is not limited to: the user's touch input of the translation control through a touch device such as a finger or a stylus, voice command input, specific gesture input, etc.; wherein the touch input includes but is not limited to click input, sliding input, etc., the click input can be a single-click input, a double-click input, or any number of click inputs, and can also be a long press input or a short press input; the specific gesture input can be any one of a single-click gesture, a sliding gesture, a drag gesture, a long press gesture, an area change gesture, a double-press gesture, and a double-click gesture. The first input in the embodiments of the present application can be set and adaptively modified according to actual needs.
[0033] In some possible implementations of the embodiments of the present application, when automatic translation is started, the first input may be an input for inputting target information. When the target information is input, there is no need to trigger translation. At this time, the target information is automatically translated.
[0034] In some possible implementations of the embodiments of the present application, the target information in the embodiments of the present application may be text, audio, or picture. When the target information is text, the target information can be directly translated; when the target information is audio, the voice needs to be converted into text, and when the target information is audio, the text needs to be recognized from the picture. The embodiments of the present application do not limit the methods used to convert voice into text and recognize text from pictures, and any available methods can be applied to the embodiments of the present application.
[0035] Step 102: In response to the first input, determining the source language corresponding to the target information;
[0036] In some possible implementations of the embodiments of the present application, the text information corresponding to the target information can be detected using language detection technology to obtain the source language corresponding to the target information. The embodiments of the present application do not elaborate on the process of detecting the text information corresponding to the target information using language detection technology, and the specific process can be referred to the description in the relevant technology.
[0037] In some possible implementations of the embodiments of the present application, step 102 may include: determining a language corresponding to a first geographical location where the first electronic device is located as a source language.
[0038] For example, when user A and user B are talking face to face, there is a need for user A to translate what user B said. At this time, the words spoken by user B can be input into the electronic device used for translation (for example, user A's mobile phone), and the geographical location of the electronic device is obtained through the positioning function of the electronic device, for example, Shenzhen; and then the language corresponding to Shenzhen is determined as the source language. For example, it is assumed that the languages used by users in Shenzhen are Mandarin, Cantonese, Chaoshan dialect, Hakka dialect and English. Then Mandarin, Cantonese, Chaoshan dialect, Hakka dialect and English are all determined as source languages.
[0039] In the embodiment of the present application, by determining the source language through the geographical location of the first electronic device, the user's translation experience of real-time translation in multilingual countries or regions can be improved, and the accuracy of the translation results can be improved.
[0040] In some possible implementations of the embodiments of the present application, step 102 may include: determining the language corresponding to the second geographical location where the first electronic device is located and the language obtained by identifying environmental information as the source language, wherein the environmental information is information obtained by collecting information about the environment where the first electronic device is located using a camera.
[0041] Exemplarily, when user A and user B are talking face to face, there is a need for user A to translate what user B said. At this time, the words spoken by user B can be input into the electronic device used for translation (for example, user A's mobile phone), and the geographical location of the electronic device can be obtained through the positioning function of the electronic device, for example, Shenzhen; assuming that the languages used by users in Shenzhen are Mandarin, Cantonese, Chaoshan dialect, Hakka dialect and English. Then, the camera of the electronic device is used to collect environmental information of the electronic device. Assuming that user A and user B are talking at user B's home, the books, newspapers and notes in user B's home are all in French. The result obtained by identifying the environmental information collected by the camera is French, then Mandarin, Cantonese, Chaoshan dialect, Hakka dialect, English and French are all determined as source languages.
[0042] In some possible implementations of the embodiments of the present application, when identifying environmental information captured by a camera, the image captured by the camera can be recognized using optical character recognition (OCR) to identify characters in the image, and then the recognized characters can be detected using language detection technology to obtain the corresponding source language.
[0043] In an embodiment of the present application, by determining the source language through the geographic location of the first electronic device and identifying the environment, the user's translation experience of real-time translation in multilingual countries or regions can be improved, and the accuracy of translation results can be improved when the user communicates with foreign users locally.
[0044] In some possible implementations of the embodiments of the present application, when the target information includes a picture, step 102 may include: obtaining a third geographic location where the picture is taken from attribute information of the picture; and determining the language corresponding to the third geographic location as the source language.
[0045] For example, assume that user B uses his electronic device to take a photo, and allows the acquisition of the geographical location of the electronic device when taking the photo. When the user takes the photo, the geographical location is stored in the attribute information of the photo, and user B sends the photo to user A. User A inputs the photo sent by user B into the electronic device used for translation, and the electronic device acquires the geographical location where the photo was taken from the attribute information of the photo. Assuming that the acquired geographical location is Shenzhen, the language corresponding to the Shenzhen area is determined as the source language.
[0046] In the embodiment of the present application, determining the source language by obtaining the geographical location where the photo was taken can enhance the user's translation experience when translating pictures of other locations and improve the accuracy of the translation.
[0047] Step 103: When the source language includes a first language and a second language, the target information is translated using a first translation method and a second translation method to obtain a first translation result and a second translation result;
[0048] In some possible implementations of the embodiments of the present application, the first translation method is a translation method for translating a first language into a target language, and the second translation method is a translation method for translating a second language into the target language.
[0049] It should be noted that, when the source languages determined in step 102 include the target language, the target information is translated using only the methods corresponding to the source languages other than the target language among the determined source languages.
[0050] The embodiments of the present application do not limit the method for determining the target language, and any available method can be applied to the embodiments of the present application, for example, using the language selected by the user as the target language, or using the official language of the country where the user is located as the target language, etc.
[0051] Exemplarily, it is assumed that the source languages determined in step 102 include Mandarin, Cantonese, Teochew, Hakka and English, and the target language is Chinese (ie Mandarin).
[0052] The target information is translated using a translation method of translating Cantonese into Chinese, a translation method of translating Chaoshan dialect into Chinese, a translation method of translating Hakka dialect into Chinese, and a translation method of translating English into Chinese respectively.
[0053] In some possible implementations of the embodiments of the present application, the target information can be translated in a multi-device collaborative manner. For example, a user has multiple electronic devices, each of which has the ability to independently process information, and the multiple electronic devices include but are not limited to: mobile phones, smart watches, tablet computers, VR glasses, etc., and Internet of Things (IOT) devices such as smart TVs or smart speakers. Then, multiple electronic devices can be used to translate the target information separately. Based on this, step 103 may include: sending the target information and the indication information to the second electronic device and the third electronic device, wherein the indication information is used to instruct the second electronic device to translate the target information in a first translation mode, and the third electronic device to translate the target information in a second translation mode; receiving the first translation result obtained by the translation target information sent by the second electronic device and receiving the second translation result obtained by the translation target information sent by the third electronic device.
[0054] Exemplarily, assuming that the target language is Chinese (Mandarin), the determined source languages include Mandarin, Cantonese, Chaoshan dialect, Hakka and English, and the instruction information may be that the mobile phone translates the target information by translating Cantonese into Chinese, the smart watch translates the target information by translating Chaoshan dialect into Chinese, the tablet computer translates the target information by translating Hakka into Chinese, and the VR glasses translate the target information by translating English into Chinese. The first electronic device sends the target information and the indication information to the mobile phone, smart watch, tablet computer and VR glasses. After receiving the target information and the indication information, the mobile phone translates the target information by translating Cantonese into Chinese, the smart watch translates the target information by translating Chaoshan dialect into Chinese, the tablet computer translates the target information by translating Hakka dialect into Chinese, and the VR glasses translates the target information by translating English into Chinese; the mobile phone, smart watch, tablet computer and VR glasses send their respective translation results of the target information to the first electronic device, and the first electronic device receives the translation results sent by the mobile phone, smart watch, tablet computer and VR glasses.
[0055] In some possible implementations of the embodiments of the present application, before sending the target information and the indication information to the second electronic device and the third electronic device, the translation method provided by the embodiments of the present application may also include: determining the translation methods used by the second electronic device and the third electronic device to translate the target information respectively according to the distances of the second electronic device and the third electronic device to the first electronic device respectively and / or the performance of the second electronic device and the third electronic device and the proportions of users corresponding to the first language and the second language respectively.
[0056] In some possible implementations of the embodiments of the present application, determining the translation methods used by the second electronic device and the third electronic device to translate the target information respectively according to the distances of the second electronic device and the third electronic device from the first electronic device and / or the performance of the second electronic device and the third electronic device and the proportion of users corresponding to the first language and the second language respectively may include: sorting the first language and the second language according to the proportion of users corresponding to the first language and the second language respectively and sorting the second electronic device and the third electronic device according to the distances of the second electronic device and the third electronic device from the first electronic device and / or the performance of the second electronic device and the third electronic device; determining the translation methods used by the second electronic device and the third electronic device to translate the target information respectively according to the sorting order of the first language and the second language and the sorting order of the second electronic device and the third electronic device.
[0057] Exemplarily, user B is a guest at user A's home, and there is a need for user A to translate what user B said. The geographical location of the first electronic device is obtained through the positioning function of the first electronic device, for example, Shenzhen. Assume that the languages used by users in Shenzhen are Mandarin, Cantonese, Chaoshan dialect, Hakka dialect and English, and the proportions of users of Mandarin, Cantonese, Chaoshan dialect, Hakka dialect and English are 25%, 24%, 23%, 22% and 6% respectively. The target language is Chinese. The distance from the mobile phone to the first electronic device is less than the distance from the smart watch to the first electronic device, the distance from the smart watch to the first electronic device is less than the distance from the tablet computer to the first electronic device, and the distance from the tablet computer to the first electronic device is less than the distance from the VR glasses to the first electronic device. It can be determined that the mobile phone uses a translation method of translating Cantonese into Chinese to translate the target information, the smart watch uses a translation method of translating Chaoshan dialect into Chinese to translate the target information, the tablet computer uses a translation method of translating Hakka dialect into Chinese to translate the target information, and the VR glasses use a translation method of translating English into Chinese to translate the target information.
[0058] As another example, user B is a guest at user A's home, and there is a need for user A to translate what user B said. The geographical location of the first electronic device is obtained through the positioning function of the first electronic device, for example, Shenzhen. Assume that the languages used by users in Shenzhen are Mandarin, Cantonese, Chaoshan dialect, Hakka and English, and the proportions of users of Mandarin, Cantonese, Chaoshan dialect, Hakka and English are 25%, 24%, 23%, 22% and 6% respectively. The target language is Chinese. The performance of the tablet computer is better than that of the mobile phone, the performance of the mobile phone is better than that of the VR glasses, and the performance of the VR glasses is better than that of the smart watch. It can be determined that the tablet computer translates the target information using the translation method of translating Cantonese into Chinese, the mobile phone translates the target information using the translation method of translating Chaoshan dialect into Chinese, the VR glasses translate the target information using the translation method of translating Hakka into Chinese, and the smart watch translates the target information using the translation method of translating English into Chinese.
[0059] As another example, user B is a guest at user A's home, and there is a need for user A to translate what user B said. The geographical location of the first electronic device is obtained through the positioning function of the first electronic device, for example, Shenzhen. Assume that the languages used by users in Shenzhen are Mandarin, Cantonese, Chaoshan dialect, Hakka dialect and English, and the proportions of users of Mandarin, Cantonese, Chaoshan dialect, Hakka dialect and English are 25%, 24%, 23%, 22% and 6% respectively. The target language is Chinese. According to the distance of the mobile phone, smart watch, tablet computer, VR glasses to the first electronic device and the performance of the mobile phone, smart watch, tablet computer, and VR glasses, the comprehensive scores of the mobile phone, smart watch, tablet computer, and VR glasses are determined. Assume that the comprehensive score of the tablet computer is greater than the comprehensive score of the mobile phone, the comprehensive score of the mobile phone is greater than the comprehensive score of the VR glasses, and the comprehensive score of the VR glasses is greater than the comprehensive score of the smart watch. It can be determined that the tablet computer translates the target information by translating Cantonese into Chinese, the mobile phone translates the target information by translating Chaoshan dialect into Chinese, the VR glasses translate the target information by translating Hakka dialect into Chinese, and the smart watch translates the target information by translating English into Chinese.
[0060] The embodiments of the present application do not limit the methods used to determine the distances from the second electronic device and the third electronic device to the first electronic device, respectively. Any available methods can be applied to the embodiments of the present application.
[0061] In some possible implementations of the embodiments of the present application, different weights can be set for different distances, and different weights can also be set for different performances. When determining the comprehensive scores of the second electronic device and the third electronic device, the distance and performance can be weighted and summed to obtain the comprehensive scores of the second electronic device and the third electronic device.
[0062] In some possible implementations of the embodiments of the present application, when translating the target information in a multi-device collaborative manner, factors such as the remaining power, CPU utilization, and memory utilization of the second electronic device and the third electronic device may also be considered.
[0063] In some possible implementations of the embodiments of the present application, the number of electronic devices owned by the user may be less than the number of source language types. For example, the determined source languages are Cantonese, Chaoshan dialect, Hakka, and English, and the user proportions of Cantonese, Chaoshan dialect, Hakka, and English are 24%, 23%, 22%, and 6% respectively. The electronic devices owned by the user are mobile phones, smart watches, and tablet computers. Determine the comprehensive scores of the mobile phones, smart watches, and tablet computers. Assume that the comprehensive score of the tablet computer is greater than the comprehensive score of the mobile phone, and the comprehensive score of the mobile phone is greater than the comprehensive score of the smart watch. Then it can be determined that the tablet computer translates the target information using the translation method of translating Cantonese into Chinese and using the translation method of translating English into Chinese, the mobile phone translates the target information using the translation method of translating Chaoshan dialect into Chinese, and the smart watch translates the target information using the translation method of translating Hakka into Chinese.
[0064] Step 104: Synthesize the first valid translation part in the first translation result and the second valid translation part in the second translation result to obtain a third translation result.
[0065] In some possible implementations of the embodiments of the present application, the first valid translation part is the part belonging to the target language in the first translation result, and the second valid translation part is the part belonging to the target language in the second translation result. It can be understood that the first translation part is the part different from the target information in the first translation result, and the second translation part is the part different from the target information in the second translation result; the part identical to the target information refers to the part that cannot be translated when translating the target information using the translation method; the part different from the target information refers to the part other than the part identical to the target information in the translation result.
[0066] Exemplarily, assume that the target information is: Tomorrow don't need to go to work, what day is it, come out the material? together. Among them, the language of "Tomorrow don't need to go to work" in the target information is Cantonese, the language of "what day is it" in the target information is Chaoshan dialect, the language of "Hakka" in the target information is Cantonese, and the language of "together" in the target information is English.
[0067] Using the translation method of translating Cantonese into Chinese to translate "Tomorrow don't need to go to work, what day is it, come out the material? together.", the result obtained is: Tomorrow don't need to go to work, what day is it, come out the material? together. The valid translation part is "Tomorrow don't need to go to work".
[0068] Using the translation method of translating Chaoshan dialect into Chinese to translate "Tomorrow don't need to go to work, what day is it, come out the material? together.", the result obtained is: Tomorrow don't need to go to work, tomorrow morning, come out the material? together. The valid translation part is "tomorrow morning".
[0069] Translate the sentence "听日唔使返工,吗日道,出来料?together。" using the translation method of translating Hakka into Chinese. The resulting translation is: 听日唔使返工,吗日道,出来玩吗?together。 The effective translation part is "出来玩吗?".
[0070] Translate the sentence "听日唔使返工,吗日道,出来料?together。" using the translation method of translating English into Chinese. The resulting translation is: 听日唔使返工,吗日道,出来料?一起。 The effective translation part is "一起".
[0071] It can be understood that the effective translation part in the embodiments of the present application can also refer to the part in the translation result that is different from the target information.
[0072] Combine the above-mentioned effective translation parts to obtain the translation result: 明天不用上班,明天上午,出来玩吗?一起。
[0073] Exemplarily, as Figure 2 and Figure 3 shown, Figure 2 is the first schematic diagram of the translation process provided by the embodiments of the present application, Figure 3 is the second schematic diagram of the translation process provided by the embodiments of the present application.
[0074] In Figure 2 , translate the target information "听日唔使返工,吗日道,出来料?together。" using the translation methods of translating Cantonese into Chinese, Chaoshan dialect into Chinese, Hakka into Chinese, and English into Chinese respectively, and then combine the effective translation parts in each translation result to obtain the final translation result. In Figure 3 In, translate the text in the picture shown in Figure 3 to obtain the corresponding translation result.
[0075] In an embodiment of the present application, a first input indicating translation of target information is received; in response to the first input, the source language corresponding to the target information is determined; in the case where the source language includes the first language and the second language, the target information is translated using the first translation method and the second translation method respectively to obtain a first translation result and a second translation result; the first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain a third translation result. In this way, by translating the target information using the first translation method and the second translation method to obtain the first translation result and the second translation result, the first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain the final translation result. Compared with the related art, the final translation result obtained by the embodiment of the present application is accurate and can improve the accuracy of the translation.
[0076] Figure 4 400 is a schematic diagram of the structure of the translation device provided in the embodiment of the present application. The translation device 400 may include:
[0077] The receiving module 401 is used to receive a first input indicating to translate the target information;
[0078] A first determination module 402, configured to determine a source language corresponding to the target information in response to the first input;
[0079] A translation module 403, for translating the target information using a first translation method and a second translation method respectively to obtain a first translation result and a second translation result when the source language includes a first language and a second language;
[0080] The combining module 404 is used to synthesize the first valid translation part in the first translation result and the second valid translation part in the second translation result to obtain a third translation result.
[0081] In an embodiment of the present application, a first input indicating translation of target information is received; in response to the first input, the source language corresponding to the target information is determined; in the case where the source language includes the first language and the second language, the target information is translated using the first translation method and the second translation method respectively to obtain a first translation result and a second translation result; the first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain a third translation result. In this way, by translating the target information using the first translation method and the second translation method to obtain the first translation result and the second translation result, the first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain the final translation result. Compared with the related art, the final translation result obtained by the embodiment of the present application is accurate and can improve the accuracy of the translation.
[0082] In some possible implementations of the embodiment of the present application, the first determining module 402 is specifically configured to:
[0083] The language corresponding to the first geographical location where the first electronic device is located is determined as the source language.
[0084] In some possible implementations of the embodiment of the present application, the first determining module 402 is specifically configured to:
[0085] The language corresponding to the second geographical location where the first electronic device is located and the language obtained by identifying environmental information are determined as source languages, wherein the environmental information is information obtained by collecting information about the environment where the first electronic device is located using a camera.
[0086] In some possible implementations of the embodiments of the present application, the target information includes a picture;
[0087] Accordingly, the first determining module 402 is specifically configured to:
[0088] Obtaining a third geographic location where the picture was taken from the attribute information of the picture;
[0089] The language corresponding to the third geographical location is determined as the source language.
[0090] In some possible implementations of the embodiment of the present application, the translation module 403 includes:
[0091] a sending submodule, used to send the target information and the instruction information to the second electronic device and the third electronic device, wherein the instruction information is used to instruct the second electronic device to translate the target information in the first translation mode, and the third electronic device to translate the target information in the second translation mode;
[0092] The receiving submodule is used to receive a first translation result obtained by receiving translation target information sent by the second electronic device and a second translation result obtained by receiving translation target information sent by the third electronic device.
[0093] In some possible implementations of the embodiments of the present application, the translation device provided by the embodiments of the present application further includes:
[0094] The second determination module is used to determine the translation methods used by the second electronic device and the third electronic device to translate the target information respectively according to the distances from the second electronic device and the third electronic device to the first electronic device and / or the performance of the second electronic device and the third electronic device and the proportion of users corresponding to the first language and the second language respectively.
[0095] In some possible implementations of the embodiments of the present application, the second determining module includes:
[0096] a sorting submodule, configured to sort the first language and the second language according to the proportion of users corresponding to the first language and the second language respectively, and to sort the second electronic device and the third electronic device according to the distance from the second electronic device and the third electronic device to the first electronic device and / or the performance of the second electronic device and the third electronic device respectively;
[0097] The determination submodule is used to determine the translation methods used by the second electronic device and the third electronic device to translate the target information respectively according to the sorting order of the first language and the second language and the sorting order of the second electronic device and the third electronic device.
[0098] The translation device in the embodiment of the present application may be an electronic device, or a component in an electronic device, such as an integrated circuit or a chip.
[0099] The translation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0100] The translation device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented in the translation method embodiment are not described here.
[0101] Alternatively, if Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501 and a memory 502, wherein the memory 502 stores programs or instructions that can be executed on the processor 501, and when the program or instructions are executed by the processor 501, the various steps of the above-mentioned translation method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0102] Figure 6 It is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.
[0103] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.
[0104] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0105] The user input unit 607 is used to: receive a first input indicating to translate the target information;
[0106] The processor 610 is used to: determine the source language corresponding to the target information in response to the first input; when the source language includes the first language and the second language, translate the target information using the first translation method and the second translation method respectively to obtain a first translation result and a second translation result; synthesize the first valid translation part in the first translation result and the second valid translation part in the second translation result to obtain a third translation result.
[0107] In an embodiment of the present application, a first input indicating translation of target information is received; in response to the first input, the source language corresponding to the target information is determined; in the case where the source language includes the first language and the second language, the target information is translated using the first translation method and the second translation method respectively to obtain a first translation result and a second translation result; the first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain a third translation result. In this way, by translating the target information using the first translation method and the second translation method to obtain the first translation result and the second translation result, the first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain the final translation result. Compared with the related art, the final translation result obtained by the embodiment of the present application is accurate and can improve the accuracy of the translation.
[0108] In some possible implementations of the embodiments of the present application, the processor 610 is specifically configured to:
[0109] The language corresponding to the first geographical location where the first electronic device is located is determined as the source language.
[0110] In some possible implementations of the embodiments of the present application, the processor 610 is specifically configured to:
[0111] The language corresponding to the second geographical location where the first electronic device is located and the language obtained by identifying environmental information are determined as source languages, wherein the environmental information is information obtained by collecting information about the environment where the first electronic device is located using a camera.
[0112] In some possible implementations of the embodiments of the present application, the target information includes a picture;
[0113] Accordingly, the processor 610 is specifically configured to:
[0114] Obtaining a third geographic location where the picture was taken from the attribute information of the picture;
[0115] The language corresponding to the third geographical location is determined as the source language.
[0116] In some possible implementations of the embodiments of the present application, the radio frequency unit 601 or the network module 602 is used to:
[0117] Send target information and indication information to a second electronic device and a third electronic device, wherein the indication information is used to instruct the second electronic device to translate the target information in a first translation manner and the third electronic device to translate the target information in a second translation manner; receive a first translation result obtained by receiving the translation target information sent by the second electronic device and a second translation result obtained by receiving the translation target information sent by the third electronic device.
[0118] In some possible implementations of the embodiments of the present application, the processor 610 is further configured to:
[0119] Determine the translation methods used by the second electronic device and the third electronic device to translate the target information according to the distances from the second electronic device and the third electronic device to the first electronic device and / or the performance of the second electronic device and the third electronic device and the user ratios of the first language and the second language respectively.
[0120] In some possible implementations of the embodiments of the present application, the processor 610 is specifically configured to:
[0121] sorting the first language and the second language according to the user proportions corresponding to the first language and the second language respectively, and sorting the second electronic device and the third electronic device according to the distances from the second electronic device and the third electronic device to the first electronic device and / or the performances of the second electronic device and the third electronic device respectively;
[0122] According to the sorting order of the first language and the second language and the sorting order of the second electronic device and the third electronic device, the translation methods used by the second electronic device and the third electronic device when translating the target information respectively are determined.
[0123] It should be understood that in the embodiment of the present application, the input unit 604 may include a graphics processor (GPU) 6041 and a microphone 6042, and the graphics processor 6041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes a touch panel 6071 and at least one of other input devices 6072. The touch panel 6071 is also called a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0124] The memory 609 can be used to store software programs and various data. The memory 609 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 609 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0125] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.
[0126] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned translation method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0127] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer-readable storage medium, and examples of computer-readable storage media include non-transitory computer-readable media, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0128] An embodiment of the present application also provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned translation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0129] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0130] The embodiment of the present application also provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned translation method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0131] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0133] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A translation method, characterized in that: Applied to a first electronic device, the method includes: receiving a first input instructing to translate the target information; In response to the first input, determining a source language corresponding to the target information; In the case where the source language includes a first language and a second language, the target information is translated using a first translation method and a second translation method respectively to obtain a first translation result and a second translation result; The first valid translation part in the first translation result and the second valid translation part in the second translation result are synthesized to obtain a third translation result.
2. The method according to claim 1, characterized in that The determining the source language corresponding to the target information includes: The language corresponding to the first geographical location where the first electronic device is located is determined as the source language.
3. The method according to claim 1, characterized in that The determining the source language corresponding to the target information includes: The language corresponding to the second geographical location where the first electronic device is located and the language obtained by identifying environmental information are determined as the source language, wherein the environmental information is information obtained by collecting information about the environment where the first electronic device is located using a camera.
4. The method according to claim 1, characterized in that: The target information includes a picture; The determining the source language corresponding to the target information includes: acquiring a third geographical location where the picture was taken from the attribute information of the picture; The language corresponding to the third geographical location is determined as the source language.
5. The method according to claim 1, characterized in that The target information is translated by using the first translation method and the second translation method respectively to obtain a first translation result and a second translation result, including: Sending the target information and the instruction information to a second electronic device and a third electronic device, wherein the instruction information is used to instruct the second electronic device to translate the target information in the first translation manner, and the third electronic device to translate the target information in the second translation manner; The first translation result obtained by translating the target information and sent by the second electronic device is received, and the second translation result obtained by translating the target information and sent by the third electronic device is received.
6. A translation device, characterized in that: Applied to a first electronic device, the device comprises: A receiving module, configured to receive a first input indicating translation of target information; A first determination module, configured to determine a source language corresponding to the target information in response to the first input; A translation module, configured to translate the target information using a first translation method and a second translation method respectively, to obtain a first translation result and a second translation result, when the source language includes a first language and a second language; The combining module is used to synthesize the first valid translation part in the first translation result and the second valid translation part in the second translation result to obtain a third translation result.
7. The device according to claim 6, characterized in that The first determining module is specifically used for: The language corresponding to the first geographical location where the first electronic device is located is determined as the source language.
8. The device according to claim 6, characterized in that The first determining module is specifically used for: The language corresponding to the second geographical location where the first electronic device is located and the language obtained by identifying environmental information are determined as the source language, wherein the environmental information is information obtained by collecting information about the environment where the first electronic device is located using a camera.
9. The device according to claim 6, characterized in that The target information includes a picture; The first determining module is specifically used for: acquiring a third geographical location where the picture was taken from the attribute information of the picture; The language corresponding to the third geographical location is determined as the source language.
10. The device according to claim 6, characterized in that The translation module includes: a sending submodule, configured to send the target information and the instruction information to a second electronic device and a third electronic device, wherein the instruction information is used to instruct the second electronic device to translate the target information in the first translation manner, and the third electronic device to translate the target information in the second translation manner; The receiving submodule is configured to receive the first translation result obtained by translating the target information and sent by the second electronic device, and receive the second translation result obtained by translating the target information and sent by the third electronic device.
11. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the translation method according to any one of claims 1 to 5 are implemented.
