Translation method, electronic device, and computer storage medium

Through the combination of word-level language detection and different display methods, the problem of mistranslation and missing translation in mixed language translation is solved, achieving accurate translation of mixed languages ​​and improving user experience.

WO2024193413A1PCT designated stage expired Publication Date: 2024-09-26HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/081421
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-21
Filing Date
2024-03-13
Publication Date
2024-09-26

AI Technical Summary

Technical Problem

The existing translation function is prone to errors and missed translations when dealing with mixed languages. It is difficult to accurately translate content in different languages, and users need to compare them character by character, which affects the user experience.

Method used

Provide a translation method that identifies different languages ​​in mixed languages ​​through word-level language detection, and uses different display methods when displaying translation results to achieve a search-free function in the 'language dimension', avoid mistranslations and missed translations, and improve user experience experience.

Benefits of technology

It achieves accurate translation of mixed languages ​​and distinguishes content in different languages ​​through different display methods. Users can quickly locate translation results without comparing them one by one, which improves the usability and user experience of the translation function.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024081421_26092024_PF_FP
    Figure CN2024081421_26092024_PF_FP
Patent Text Reader

Abstract

The present application provides a translation method, an electronic device, and a computer storage medium. The method comprises: receiving a first input operation of a user; in response to the first input operation, displaying a first text and a second text, wherein the first text is in a first language, the second text is in a second language, and the first language is different from the second language; receiving a first translation request of the user; and displaying a first interface, the first interface comprising a third text and a fourth text, wherein the third text and the fourth text are in a third language, the third language is different from the first language, the third text is obtained by translating the first text, the fourth text corresponds to the second text, and a display mode of the third text is different from a display mode of the fourth text. By means of the present application, translation results of content in different languages can be displayed in different display modes, a "language dimension" search-free function is achieved, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Translation method, electronic device, and computer storage medium

[0001] This application claims priority to the Chinese patent application with application number 202310280352.6 filed with the State Intellectual Property Office of China on March 21, 2023, and priority to the Chinese patent application with the invention name “Translation method, electronic device and computer storage medium”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of computer technology, and in particular to a translation method, electronic equipment, and computer storage medium. Background Art

[0003] Mobile phones, tablets, and other terminals can provide a translation function, which translates the text entered or selected by the user (referred to as the source text) into text in the target language and returns it to the user. However, this translation function only works when the source text is in a single language. When the source text is in a mixed language, problems such as mistranslation and omission often occur. For example, when the source text is a mixture of English and German, the terminal may only translate the English content into Chinese content and not the German content, which is a problem of omission. Alternatively, the terminal may identify the German content as English content and translate it in the same way as the English content, resulting in incorrect translation of the German content, which is a problem of mistranslation. Therefore, the translation function has low usability and is difficult to meet user needs.

[0004] Summary of the Invention

[0005] The present application discloses a translation method, electronic device and computer storage medium, which can quickly and accurately obtain the translation results corresponding to the source text of a mixed language, and display the translation results of content in different languages ​​in different display modes, realizing the "language dimension" search-free function and improving the user experience.

[0006] In a first aspect, the present application provides a translation method, applied to an electronic device, the method comprising: receiving a first input operation from a user; displaying a first text and a second text in response to the first input operation, wherein the first text is in a first language, the second text is in a second language, and the first language is different from the second language; receiving a first translation request from the user; displaying a first interface, the first interface comprising a third text and a fourth text, wherein the third text and the fourth text are in a third language, the third language is different from the first language, the third text is translated from the first text, the fourth text corresponds to the second text, and the display method of the third text is different from the display method of the fourth text.

[0007] In some examples, the display method includes at least one of the following: whether it is highlighted, font thickness, font size, font color, whether the font is italic, font type, whether it is underlined, whether the font has a background texture, the color of the font background texture, the pattern of the font background texture, whether there is a border around the font, the font border shape, the font border thickness, and the font border color.

[0008] In the above method, for a mixed-language source text (including a first text and a second text in different languages), the electronic device can accurately obtain the translation results (including a third text and a fourth text) corresponding to the source text, avoiding the problems of mistranslation and omission. Moreover, the electronic device will display the third text and the fourth text in the translation results in different display modes. In this way, the user does not need to compare the source text and the translation results character by character, and can quickly locate the third text corresponding to the first text, thereby realizing the "language dimension" free search function and effectively meeting the needs of users.

[0009] In a possible implementation, when the second language is the same as the third language, the fourth text is the same as the second text; when the second language is different from the third language, the fourth text is obtained by translating the second text.

[0010] In the above method, the source text includes a first text in a first language different from a third language, and a second text in a second language the same as the third language. The electronic device can automatically identify and translate the first text without translating the second text, thereby avoiding omission of the first text and avoiding waste of resources caused by translating the second text.

[0011] In a possible implementation, the first interface includes the first text and the second text, the first text is displayed in the same manner as the third text, and the second text is displayed in the same manner as the fourth text.

[0012] In the above method, when the electronic device displays the source text and the corresponding translation results, the first text and the corresponding third text can be displayed in the same manner, and the second text and the corresponding fourth text can be displayed in the same manner, which further improves the usability of the "language dimension" search-free function, allowing users to quickly obtain the correspondence between the different language contents in the source text and the text in the translation results directly based on the display method, further improving the efficiency of users in finding the required text.

[0013] In a possible implementation, the first interface includes information in the first language and the second language.

[0014] In the above method, the user can intuitively obtain the language information of the source text, avoiding the user having to perform other operations to obtain the language information of the source text, reducing user operations and further improving the user experience.

[0015] In a possible implementation, the first interface includes information in the third language. In the above method, the user can intuitively obtain information in the target language (ie, the third language) to be translated, further improving the user experience.

[0016] In a possible implementation, the first interface includes a first control, and the first control is used to perform at least one of the following functions: copying the third text, saving the third text, and forwarding the third text.

[0017] In the above method, the electronic device can provide one-click copying, one-click saving, one-click forwarding and other functions for the translation result (i.e., the third text) corresponding to the first text in the first language. The user does not need to manually select the third text and then perform other operations to implement the copy / save / forwarding and other functions for the third text, thereby reducing user operations and further improving the user experience.

[0018] In one possible implementation, receiving the user's first input operation includes: receiving the user's first input operation on a second interface, wherein the second interface includes a first instant messaging application interface, and the first input operation includes selecting text on the first instant messaging application interface.

[0019] In one possible implementation, receiving the user's first input operation includes: receiving the user's first input operation on a third interface, wherein the third interface includes a first translation application interface, and the first input operation includes entering the first text and the second text in an input box of the first translation application interface.

[0020] In one possible implementation, receiving the user's first input operation includes: receiving the user's first input operation on a fourth interface, wherein the fourth interface includes a first browser application interface, the first browser application interface includes fifth text, and the first input operation includes selecting the first text and the second text in the fifth text.

[0021] In the above method, mixed language translation and the "language dimension" search-free function can be implemented in different application interfaces and different application scenarios. It is not limited to a specific scenario, has universality, and has high functional availability.

[0022] In a possible implementation, the third text in the first interface is in a highlighted state, and the first text corresponding to the third text is determined from the first text in the first language and the second text in the second language according to a preset rule.

[0023] In a possible implementation, the first language is a minority language.

[0024] In the above method, the electronic device can automatically identify the content in the source text in the language that the user may be interested in, that is, the first text in the first language, and highlight the translation result corresponding to the first text (that is, the third text), so that the user can quickly obtain the third text, further improving the efficiency of the user in obtaining the required content and providing a better user experience.

[0025] In one possible implementation, after receiving the first translation request from the user, the method further includes: using a classifier to process the first text and the second text to obtain first information, wherein the first information indicates that the first text and the second text are in a mixed language; using a tagger to obtain the language of each symbol in the first text and the second text, and obtaining a word-level language detection result, wherein the word-level language detection result includes the first language and the second language, and the first interface is displayed based on the word-level language detection result.

[0026] In one possible implementation, the method further includes: receiving a second input operation by the user; displaying a sixth text in response to the second input operation; receiving a second translation request by the user; processing the sixth text using a classifier to obtain second information, wherein the second information indicates that the sixth text is in a fourth language, the second information being a sentence-level language detection result, and the tagger is not enabled when the information obtained by the classifier is a sentence-level language detection result; and displaying a seventh text, wherein the seventh text is obtained by translating the sixth text.

[0027] In the above method, the electronic device can first perform a rapid sentence-level language detection through a classifier to determine whether the source text is a mixed language. Only when the judgment result is yes will it perform accurate word-level language detection, that is, a two-stage judgment is adopted. This can greatly improve the detection speed while ensuring the detection accuracy. Downstream translation based on such language detection results can effectively improve the downstream translation quality and translation speed.

[0028] In a second aspect, the present application provides an electronic device comprising a transceiver, a processor, and a memory; the memory is used to store a computer program, and the processor calls the computer program to execute the translation method provided in the first aspect of the present application and any one of the implementations of the first aspect.

[0029] In a third aspect, the present application provides a computer storage medium storing a computer program, which, when executed by a processor, implements the translation method provided in the first aspect of the present application and any one of the implementations of the first aspect.

[0030] In a fourth aspect, the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the translation method provided in the first aspect of the present application and any one of the implementations of the first aspect.

[0031] In a fifth aspect, the present application provides an electronic device, the electronic device including a method or apparatus for executing any aspect or embodiment of the present application. The electronic device is, for example, a chip.

[0032] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution or beneficial effect is included in at least one embodiment. Therefore, the description of a technical feature, technical solution or beneficial effect in this application does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in this application can also be combined in any appropriate manner. Those skilled in the art will understand that this application can be implemented without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in specific embodiments that do not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The following is an introduction to the drawings used in this application.

[0034] FIG1 is a schematic diagram of the hardware structure of an electronic device provided by the present application;

[0035] FIG2 is a schematic diagram of a software architecture of an electronic device provided by the present application;

[0036] FIG3 is a schematic diagram of the software architecture of another electronic device provided by the present application;

[0037] FIG4 is a schematic diagram of the architecture of a multi-granularity language detection system provided by the present application;

[0038] FIG5 is a schematic diagram of a user interface provided by the present application;

[0039] FIG6 is a schematic diagram of another user interface provided by the present application;

[0040] FIG7 is a schematic diagram of another user interface provided by the present application;

[0041] FIG8 is a flow chart of a translation method provided by the present application;

[0042] FIG9 is a flowchart of another translation method provided by the present application. DETAILED DESCRIPTION

[0043] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present application, not all of them. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of this application.

[0044] In the description of the embodiments of this application, unless otherwise specified, " / " means or. For example, A / B can mean A or B. The term "and / or" in this text is simply a description of an association relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "plurality" means two or more than two.

[0045] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0046] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or designs.

[0047] Electronic devices can provide a function of translating text input or selected by a user (i.e., text to be translated, which can be referred to as source text) into text in a target language, which can be referred to as a translation function. In this application, language can also be referred to as language, language type, language type, etc. The current translation function can be implemented in the following two ways.

[0048] Method 1: First, sentence-level language detection technology is used to identify the source text. The language detection result obtained is the predicted language of the source text (there is only one). Then, the corresponding machine translation model is determined based on the language detection result, and the source text is used as the input of the machine translation model to obtain the output translation result. It should be noted that one machine translation model is used to translate text in one language, and different machine translation models are required to translate text in different languages.

[0049] Method 1 only considers the case where the source text is in a single language (single-language). When the source text is in mixed-language (mixed-language, meaning multiple languages), problems such as mistranslation and omission of translation often occur. For example, assuming the source text is a mixed language of Chinese and Korean: "User aaa Account: aaa123 Region: Hubei Wuhan Set notes and tags Friends permissions Moments 20 Video Account More information." Method 1 may not translate the Korean content (for example, if the target language is Chinese), and the translation result may be consistent with the source text, indicating an omission. For another example, if the source text is a mixture of English and German (He turned around and asked: "Entschuldigen Sie, sprechen Sie Deutsch?" but passersby ignored him and walked straight ahead), Method 1 may identify the German content in the source text as English content and translate the German content in the same way as English content, resulting in an incorrect translation of the German content (for example, "Entschuldigen Sie, sprechen Sie Deutsch?" is translated as "Enturdigen Sie, sprechen Sie Deutsch?"), indicating a mistranslation. As a result, the translation quality is poor and it is difficult to meet user needs.

[0050] Method 2: First, word-level language detection is used to identify the source text. The language detection result is the predicted language (or languages) of each character (i.e., word, phrase, or punctuation mark) in the source text. The source text is then split by language, and texts belonging to the same language are used as input to a machine translation model corresponding to that language to obtain output. Finally, the outputs of at least one machine translation model are combined to obtain the translation result. For example, assuming that the source text is a mixture of English and German (He turned around and asked:"EntschuldigenSie,sprechen Sie Deutsch?"but passersby ignored him and walked straight ahead.), the language detection result is: the language of characters 0-5 (i.e., He turned around and asked:) and characters 15-23 (i.e., but passersby ignored him and walked straight ahead.) is English, and the language of characters 6-14 (i.e., "EntschuldigenSie,sprechen Sie Deutsch?") is German. Therefore, characters 0-5 and characters 15-23 will be sent to the corresponding machine translation model for English for translation, and characters 6-14 will be sent to the corresponding machine translation model for German for translation.

[0051] Method 2 only considers the case where the source text is mixed-language. When the source text is in a single language, Method 2 still requires language detection for each character in the source text. This not only fails to improve translation quality, but also significantly increases computing costs, resulting in a significant decrease in translation speed. In actual translation scenarios, the source text is more likely to be in a single language than in a mixed language. Therefore, the cost of using Method 2 far exceeds the benefits, and the usability of the translation function is poor.

[0052] In methods one and two, when the source text is in mixed languages, when the electronic device displays the translation results, the texts in different languages ​​are displayed in the same way, but the user may only want to obtain the content in one of the languages. The user often needs to compare the source text and the translation results character by character, which can easily make the user dizzy and unable to find the required translation content, seriously affecting the user experience.

[0053] The present application provides a translation method, which is applied to an electronic device. The electronic device can first determine whether the source text is a single language or a mixed language. When the source text is a single language, the language detection result of the source text can be directly obtained based on the judgment result. When the source text is a mixed language, the language detection result is obtained using word-level language detection technology, and then translation is performed based on the obtained language detection result. It can be understood that when the source text is a single language, the sentence-level language detection technology is used, and when the source text is a mixed language, the word-level language detection technology is used. In this way, the translation speed can be greatly improved while ensuring the translation quality.

[0054] Furthermore, for source texts in mixed languages, electronic devices can use different display methods to display content in different languages ​​when displaying translation results. For example, for source texts that include content in two languages, electronic devices can highlight (e.g., highlight) the translation result of the content in one of the languages ​​when displaying translation results. The content in this language can be understood as the content in the language that the electronic device automatically recognizes as the user's possible interest / requirement (which can be called the language of interest content). In other words, the electronic device provides a "language dimension" free search function, allowing users to quickly obtain the content they need.

[0055] Therefore, this application can solve the technical problems existing in the above-mentioned methods 1 and 2, meet the needs of users in translation scenarios, and improve the usability of the translation function.

[0056] "Highlighting" in this application may be, but is not limited to, highlighting, bold font display, italic font display, underlining, background texture, borders such as circles or rectangles around characters, font color different from the font color of other texts, font type different from the font type of other texts (for example, Kaiti and Songti belong to different font types), font size different from the font size of other texts, etc.

[0057] In the present application, the electronic device may be a mobile phone, a tablet computer, a handheld computer, a desktop computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), as well as smart home devices such as smart TVs and smart cameras, wearable devices such as smart bracelets, smart watches, and smart glasses, extended reality (XR) devices such as augmented reality (AR), virtual reality (VR), and mixed reality (MR), in-vehicle devices, or smart city devices. The embodiments of the present application do not impose any special restrictions on the specific types of electronic devices.

[0058] FIG1 exemplarily shows a schematic diagram of the hardware structure of an electronic device 100 .

[0059] It should be understood that the electronic device 100 shown in FIG1 is merely an example of an electronic device, and that the electronic device 100 may have more or fewer components than shown, may combine two or more components, or may have a different component configuration. The various components shown in FIG1 may be implemented in hardware, including one or more signal processing and / or application specific integrated circuits, software, or a combination of hardware and software.

[0060] As shown in Figure 1, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0061] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors. The controller may generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0062] Processor 110 may also include a memory for storing instructions and data. In one embodiment, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0063] In one embodiment, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0064] The charging management module 140 is configured to receive charging input from a charger. While charging the battery 142, the charging management module 140 can also provide power to the electronic device 100 via the power management module 141. The power management module 141 is configured to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160.

[0065] The wireless communication functionality of electronic device 100 can be implemented using antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, a modem processor, and a baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In another embodiment, the antenna can be used in conjunction with a tuning switch.

[0066] The mobile communication module 150 can provide wireless communication solutions for the electronic device 100, including second generation (2G), third generation (3G), fourth generation (4G), fifth generation (5G), and sixth generation (6G). The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, filter and amplify the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor and convert them into electromagnetic waves for radiation via the antenna 1. In one embodiment, at least some of the functional modules of the mobile communication module 150 can be located in the processor 110. In another embodiment, at least some of the functional modules of the mobile communication module 150 and at least some of the modules of the processor 110 can be located in the same device.

[0067] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In one embodiment, the modem processor may be an independent device. In another embodiment, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0068] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0069] In one embodiment, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0070] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0071] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In one embodiment, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0072] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0073] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and transformed into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and other factors. It can also optimize parameters such as exposure and color temperature of the captured scene. In one embodiment, the ISP can be located within camera 193.

[0074] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In one embodiment, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0075] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0076] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0077] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0078] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In one embodiment, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0079] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0080] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0081] Microphone 170C, also known as a "microphone" or "speaker," converts sound signals into electrical signals. When making a call or sending a voice message, a user can place their mouth close to microphone 170C and speak, inputting the sound signal into microphone 170C. Electronic device 100 may be equipped with at least one microphone 170C.

[0082] The headphone jack 170D is used to connect a wired headphone.

[0083] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In one embodiment, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a device comprising at least two parallel plates with conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In one embodiment, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions.

[0084] The gyro sensor 180B may be used to determine the motion posture of the electronic device 100 .

[0085] The air pressure sensor 180C is used to measure air pressure.

[0086] The magnetic sensor 180D includes a Hall sensor, and the electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip leather case.

[0087] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes).

[0088] The distance sensor 180F is used to measure distance.

[0089] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.

[0090] The ambient light sensor 180L is used to sense the brightness of the ambient light.

[0091] The fingerprint sensor 180H is used to collect fingerprints.

[0092] The temperature sensor 180J is used to detect temperature.

[0093] The touch sensor 180K is also called a "touch-sensitive device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In another embodiment, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0094] The bone conduction sensor 180M can acquire vibration signals.

[0095] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0096] Motor 191 can generate vibration prompts.

[0097] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0098] The SIM card interface 195 is used to connect a SIM card.

[0099] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. For example, the software system with a layered architecture can be an Android system, a Harmony operating system (OS), or other software systems. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100.

[0100] FIG2 exemplarily shows a schematic diagram of a software architecture of an electronic device 100 .

[0101] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In one embodiment, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0102] The application layer can include a series of application packages.

[0103] As shown in Figure 2, the application package may include applications such as camera, calendar, music, gallery, short message, call, navigation, translation, browser, etc. The translation in this application can be a standalone application or a functional module integrated into other applications, which is not limited in this application. The application in this application can also be replaced by other forms of software such as mini-programs and atomic services.

[0104] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0105] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.

[0106] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0107] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0108] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0109] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0110] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0111] The notification manager enables applications to display notification information in the status bar. This can be used to convey notification-type messages and can disappear automatically after a short period of time without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be used to display notifications in the form of icons or scrolling text in the top status bar of the system, such as notifications from applications running in the background, or notifications that appear on the screen in the form of dialog windows. For example, a text message can be displayed in the status bar, a notification sound can be emitted, the electronic device 100 can vibrate, an indicator light can flash, etc.

[0112] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0113] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0114] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0115] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0116] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0117] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0118] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0119] A 2D graphics engine is a drawing engine for 2D drawings.

[0120] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0121] The following describes the workflow of the software and hardware of the electronic device 100 in conjunction with a translation scenario.

[0122] When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation, and other information). The original input event is stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is a translation control of the translation application, the translation application calls the interface of the application framework layer, translates the source text entered by the user in the input box of the translation application and obtains the text in the target language (i.e., the translation result), and then controls the display driver by calling the kernel layer to display the text in the target language through the display screen 194.

[0123] FIG3 exemplarily shows a schematic diagram of a software architecture of another electronic device 100 .

[0124] As shown in Figure 3, electronic device 100 may include a multi-granularity language detection system 210, a point-to-point recommendation system 220, a translation system 230, and a display system 240. Translation system 230 may include N translation systems, any one of which may be represented as translation system i, which is used to translate text in the corresponding language i, where i is a positive integer less than or equal to N, and N is a positive integer greater than 1.

[0125] The multi-granularity language detection system 210 can be used to identify the language of the source text input or selected by the user. The multi-granularity language detection system 210 can first determine whether the source text is a single language or a mixed language. Then, based on the determination result, it can select whether to perform word-level language detection on the source text to obtain the language of the source text. Finally, based on the obtained language of the source text, it can select the next-level system to receive the source text. In case 1 shown in Figure 3, when the multi-granularity language detection system 210 recognizes that the source text is a single language, it can directly identify the language of the entire source text. The language that can be identified is at most one, and the recognition result can be called a sentence-level language detection result. After the multi-granularity language detection system 210 obtains the sentence-level language detection result, it can send the source text to the translation system in the translation system 230 that corresponds to the sentence-level language detection result. Figure 3 uses the sentence-level language detection result for language N as an example for illustration. In this case, the multi-granularity language detection system 210 will send the source text to translation system N for translating language N. In case 2 shown in Figure 3, when the multi-granularity language detection system 210 recognizes that the source text is a mixed language, it can perform word-level language detection on the source text, that is, identify the language of each character (i.e., word, phrase or punctuation mark) in the source text. At least one language is identified, and the recognition result can be called a word-level language detection result. After the multi-granularity language detection system 210 obtains the word-level language detection result, it can send the source text and the word-level language detection result together to the click recommendation system 220 for processing.

[0126] The click recommendation system 220 can be used to identify content in a language that the user may be interested in (which may be referred to as language of interest content) in the source text. The click recommendation system 220 can identify content in at least one language that the user may be interested in (i.e., language of interest content) from the content in multiple languages ​​included in the source text according to preset rules, based on the word-level language detection results sent by the multi-granularity language detection system 210, the target language, and pre-stored language category information. Content in the source text other than the language of interest content can be referred to as non-language of interest content. For specific examples, see S104-S109 in Figure 8 below. Among them, the translation function of the electronic device 100 is to translate the source text into a text in the target language. The target language can be preset by the electronic device 100 or set by the user. Language category information can include, but is not limited to, the classification of languages ​​on the Internet, such as whether it is classified as a minority language. After the click-through recommendation system 220 identifies content in a language of interest, it can send the content in the language of interest to the corresponding translation system in the translation system 230 based on the language of the content. If the content in the language of interest includes content in multiple languages, the content in different languages ​​within the content in the language of interest will be sent to different translation systems in the translation system 230 for processing. In one embodiment, the click-through recommendation system 220 can also send content in a language of non-interest to the corresponding translation system in the translation system 230 based on the language of the content in the language of non-interest. If the content in the language of non-interest includes content in multiple languages, the content in different languages ​​within the content in the language of non-interest will be sent to different translation systems in the translation system 230 for processing.

[0127] Translation system 230 can be used to receive a source text and output a translation result of the source text to display system 240. Any translation system in translation system 230 (translation system i) can be used to receive and translate a text in language i. In case 2 shown in FIG3 (i.e., the source text is in a mixed language), translation system 230 can also be used to recombine the translation results output by multiple translation systems, i.e., to arrange and combine the translation results according to the arrangement of characters in the source text, and obtain a translation result that is consistent with the format of the source text.

[0128] The display system 240 can be used to display the translation results of the source text. In case 2 shown in Figure 3 (i.e., the source text is in a mixed language), the display system 240 can use different display methods to display the translation results of the content in the language of interest and the translation results / non-interested language content of the language of non-interest, for example, highlighting the translation results of the language of interest. Among them, when the recommendation system 220 clicks to send the non-interested language content to the translation system 230 for translation, the display system 240 displays the translation results of the non-interested language content. When the non-interested language content is not translated, the display system 240 displays the non-interested language content.

[0129] In one embodiment, the electronic device 100 may further include an interactive module, which may be used to receive user operations on the translation results of the content in the language of interest displayed by the display system 240, and trigger copying, forwarding, and saving functions, etc. for the translation results based on the user operations.

[0130] Next, the architecture and processing of the multi-granularity language detection system 210 shown in FIG3 are exemplarily introduced.

[0131] FIG4 exemplarily shows a schematic diagram of the architecture of a multi-granularity language detection system 210 in an electronic device 100 .

[0132] The multi-granularity language detection system 210 shown in FIG4 may be constructed based on a deep learning model and trained using a stochastic gradient descent method through multi-task self-supervised learning.

[0133] As shown in Figures 4(A) and (B), the multi-granularity language detection system 210 may include a language model 211, a classifier 212, and a tagger 213. The language model 211 may be a BERT model, which can be used to obtain a high-dimensional representation of the input content. The classifier 212 can be used to determine whether the source text is monolingual or mixed-language. The tagger 213 can be used to identify the language of each character (i.e., word, phrase, or punctuation mark) in the source text.

[0134] Next, the processing of the multi-granularity language detection system 210 is described by assuming that the source text is a text of length T (including T characters). The source text can be represented as W = {w t |t=1,…,T},w t The tth character in the source text from front to back.

[0135] First, as shown in (A) and (B) of FIG4 , the language model 211 may receive a source text W and a preset detection character [CLS] as input, and for each character w in the source text, t And the detection character [CLS] is represented in high dimension, and the corresponding latent vector is output: the latent vector H corresponding to the source text is H = {h t |t=1,…,T} and the latent vector h corresponding to the detected character [CLS] , where h t It is w t The corresponding latent vector. The detection character [CLS] can be a character added before the source text W to determine whether the source text is a single language or a mixed language.

[0136] Then, as shown in (A) and (B) of FIG4 , the latent vector h corresponding to the detected character [CLS] output by the language model 211 is [CLS] It can be input to the classifier 212, which can classify the [CLS] Determine whether the source text W is a single language or a mixed language, and output the corresponding determination result. The determination result output by the classifier 212 can be used to determine whether to enable the tagger 213.

[0137] As shown in case 1 in FIG4(A), when the classifier 212 determines that the source text W is a single language, it can directly output the identifier of the language of the entire source text (i.e., the sentence-level language detection result). For example, the identifier of English is [EN], the identifier of German is [DE], and the identifier of Chinese is [ZH]. The identifiers of other languages ​​are similar and are not listed one by one. FIG4(A) takes the sentence-level language detection result of English as an example for illustration. In case 1, the tagger 213 is not enabled. Therefore, even if the tagger 213 receives the latent vector H corresponding to the source text output by the language model 211, it will not process it. The tagger 213 shown in FIG4(A) is gray, indicating that it is not enabled. Therefore, in case 1, the output of the multi-granularity language detection system 210 is the output of the classifier 212, i.e., the sentence-level language detection result.

[0138] As shown in case 2 of FIG4 (B), when the classifier 212 determines that the source text W is a mixed language, it can output a preset mixed symbol [MIX], which indicates that the source text is a mixed language. In this case, the tagger 213 will be activated. After the classifier 212 outputs the mixed symbol [MIX], the tagger 213 can identify the language of each character in the source text based on the input content (i.e., the latent vector H corresponding to the source text output by the language model 211) and output the language of each character in the source text (i.e., the word-level language detection result), which can be represented as U = {u t |t=1,…,T}, where u t It is w t The description of the language identifier is similar to that of the language identifier output by classifier 212, and will not be repeated here. Therefore, in case 2, the output of multi-granularity language detection system 210 is the output U of tagger 213, that is, the word-level language detection result.

[0139] In case 1, the multi-granularity language detection system 210 performs a rapid sentence-level language detection process (implemented by the classifier 212) but does not perform a word-level language detection process (the tagger 213 is not enabled). In case 2, the multi-granularity language detection system 210 first performs a rapid sentence-level language detection process (implemented by the classifier 212) and then performs a precise word-level language detection process (implemented by the tagger 213). The multi-granularity language detection system 210 shown in Figure 4 uses a deep learning model to simultaneously implement sentence-level language detection and word-level language detection, and can output sentence-level language detection results or multi-granularity language detection results as appropriate.

[0140] The multi-granularity language detection system 210 shown in FIG4 can first perform a rapid sentence-level language detection to determine whether the source text is a mixed language. Only when the judgment result is yes will accurate word-level language detection be performed, that is, a two-stage judgment is adopted. This can greatly improve the detection speed while ensuring the detection accuracy. Performing downstream translation based on such language detection results can effectively improve the downstream translation quality and translation speed.

[0141] It is understandable that the architecture and processing process described in Figure 4 do not constitute a specific limitation on the multi-granularity language detection system 210. The multi-granularity language detection system 210 in the embodiments of the present application may include but is not limited to any system, module, deep learning model and / or statistical model that can implement functions similar to those implemented by the aforementioned multi-granularity language detection system 210.

[0142] The following describes the application scenarios involved in the embodiments of the present application and user interface examples in these scenarios.

[0143] FIG5 exemplarily shows a schematic diagram of a user interface of a translation scenario.

[0144] As shown in FIG5(A), electronic device 100 may display user interface 510 of a translation application. User interface 510 may include language information 511, an input box 512, a translation control 513, and a display box 514. Language information 511 may include source language information 511A and target language information 511B. Source language information 511A may display "Auto Detect," indicating that electronic device 100 automatically detects the language of the source text during translation. Source language information 511A may also allow the user to select the language of the source text, for example, by selecting "English," "German," or "Chinese." Target language information 511B may display a default or user-selected target language. Specific option examples are similar to those for source language information 511A. User interface 510 uses the example of target language information 511B displaying "Chinese" as an example. The input box 512 can be used to input the source text to be translated. The input box 512 in the user interface 510 displays the source text that has been entered (He turned around and asked: "EntschuldigenSie, sprechen Sie Deutsch?" but passersby ignored him and walked straight ahead.). The translation control 513 can be used to trigger the translation of the text in the input box 512. The display box 514 can be used to display the translation result of the text in the input box 512. The electronic device 100 can receive a user operation on the translation control 513 (the user operation is, for example, a touch operation, and the touch operation is, for example, a click operation). In response to the user operation, the source text displayed in the input box 512 is translated into a text in the target language (i.e., Chinese), and the text in the target language is displayed in the display box 514. For a specific example, see the user interface 520 shown in (B) of Figure 5.

[0145] As shown in (B) of Figure 5, user interface 520 is similar to user interface 510, except that electronic device 100 displays the source text in input box 512 in a different manner. In user interface 520, German text 512A ("EntschuldigenSie, sprechen Sie Deutsch?") included in input box 512 is displayed differently from the English text, and the German text can be in a highlighted (e.g., highlighted) state. Furthermore, display box 514 in user interface 520 displays the translation result of the source text (he turned around and asked, "Excuse me, do you speak German?" But the passerby ignored him and walked straight ahead), wherein the translation result 514A of the German text in the source text ("Excuse me, do you speak German?") is displayed differently from the translation result of the English text, and the translation result of the German text is in a highlighted (e.g., highlighted) state. In this way, the user can quickly obtain the content of the same language in the source text and the translation result through the input box 512 and the display box 514 in the user interface 520. The user no longer needs to compare the source text and the translation result character by character, thereby realizing the "language dimension" free search function and improving the user experience.

[0146] As shown in FIG5(B), user interface 520 further includes a copy control 521, a save control 522, and a forward control 523, wherein copy control 521 can be used to trigger copying the translation result of the German text highlighted in display box 514, save control 522 can be used to trigger saving the translation result of the German text highlighted in display box 514, and forward control 523 can be used to trigger forwarding the translation result of the German text highlighted in display box 514, for example, by forwarding it to a contact via a short message, forwarding it to a social friend via a social application, etc. In other words, electronic device 100 can provide auxiliary interactive functions such as one-click copying, saving, and forwarding of translation results of content in a language of interest, further enhancing the user experience.

[0147] FIG6 exemplarily shows a schematic diagram of a user interface in yet another translation scenario.

[0148] As shown in FIG6 (A), the electronic device 100 can display a user interface 610. In one embodiment, the user interface 610 is an interface for displaying the personal information of user 1 in an instant messaging application. The user interface 610 may include a user nickname 611, an account name 612, a location 613, a note control 614, a permission control 615, a control 616, a control 617, a message control 618, and a call control 619. Among them, the user nickname 611 is used to display the nickname of user 1. The account name 612 may include the characters "Account: ", the region 613 may include the characters "Region: Hubei Wuhan". The note control 614 may include the characters "Set notes and tags", which are used for the current user to set notes and / or tags for user 1. The authority control 615 may include the characters "Friends' authority", which are used for the current user to set authority for user 1. The control 616 may include the characters "Circle" and pictures, which are used to trigger the display of pictures, texts and other content posted by user 1. The control 617 may include the characters "More information", which are used to trigger the display of other information about user 1. The message control 618 may include the characters "Send message", which are used to trigger the display of The chat interface with user 1 is displayed. The call control 619 may include the characters "audio and video call" to trigger an audio call / video call with user 1. The electronic device 100 can receive a user operation on the user interface 610, and the user operation is, for example, a touch operation, and the touch operation is, for example, but not limited to, a two-finger press, a three-finger press, or a sliding operation. FIG6 (A) illustrates the user operation as a two-finger press operation. The electronic device 100 can extract part or all of the text in the user interface 610 in response to the user operation, and the user interface 620 shown in FIG6 (B) can be displayed at this time.

[0149] As shown in FIG6 (B), the user interface 620 is similar to the user interface 610, except that a portion of the text 621 in the user interface 620 is selected. The text 621 includes characters in the user nickname 611, characters in the account name 612, characters in the region 613, and a portion of the characters in the note control 614, namely, " account: Region: Hubei Wuhan Settings", in some examples, the electronic device 100 can respond to a user operation on the text in the user interface 620, such as a touch operation, and the touch operation is such as a sliding operation, to modify the selected text, such as including more characters or fewer characters. The user interface 620 also includes a control bar 622 and a display box 623. The control bar 622 may include multiple controls, such as a scan control, a translation control, a control for collapsing the control bar 622, a shopping control, and a favorite control. The display box 623 may include a title 623A (including the characters "Extract text"), a close control 623B, text 623C, and multiple function controls for the text 623C. . Among them, the content of text 623C is the same as the text 621 in the selected state mentioned above, and can also be understood as text extracted from the user interface 610. Multiple functional controls include, for example, a select all control 623D, a search control 623E, a copy control 623F, a translation control 623G, and a share control 623H. The electronic device 100 can receive a user operation on part or all of the text in the text 623C, such as a touch operation, such as a sliding operation. In response to the user operation, part or all of the text in the text 623C is selected. Figure 6 takes the selection of all the text of text 623C as an example for explanation, and the user interface 630 shown in (C) of Figure 6 can be displayed at this time.

[0150] As shown in FIG6(C), user interface 630 is similar to user interface 620, except that all characters of text 623C in user interface 630 are selected. Electronic device 100 can receive a user operation on translation control 623G in user interface 630, such as a touch operation, such as a single click operation. In response to the user operation, electronic device 100 can translate the selected text (i.e., text 623C) into text in the target language (FIG6 uses Chinese as an example for explanation by default), and then display user interface 640 shown in FIG6(D).

[0151] As shown in FIG6 (D), the user interface 640 is similar to the user interface 610, except that the portion of the text 621 (" account: Region: Hubei Wuhan Settings”) is selected, and the user interface 640 also includes a translation box 641. The translation box 641 may include a title 641A (including the character “Translation”), a close control 641B, source language information 641C, target language information 641D, source text 641E, translated text 641F, and multiple functional controls. Among them, the source language information 641C may display “Auto Detect”, indicating that the electronic device 100 will automatically detect the language of the source text when translating. The target language information 641D may be used to display the default or user-selected target language (“Chinese”). The source text 641E has the same content as the selected text 621, including Chinese text and Korean text. The Chinese text and the Korean text are displayed differently. The Korean text and The translation text 641F is the target language (i.e., Chinese) text obtained by translating the source text 641E, which is "Little Sister Account: Lucky Arrival Region: Hubei Wuhan Settings", where "Little Sister" and "Lucky Arrival" are the Korean texts in the source text 641E. The translation results of the two Korean texts are highlighted (e.g., highlighted). The multiple functional controls include, for example, control 641G, control 641H, control 641I, and control 641J. Control 641G is used to copy the translated text 641F, control 641H is used to copy the translation result of the Korean text in the translated text 641F (i.e., "highlighted translation"), control 641I is used to share the translated text 641F, and control 641J is used to share the translation result of the Korean text in the translated text 641F (i.e., "highlighted translation").

[0152] FIG7 exemplarily shows a schematic diagram of a user interface of yet another translation scenario.

[0153] As shown in FIG7 (A), the electronic device 100 can display a user interface 710 of the browser. The user interface 710 may include a URL bar 711, website information 712, text 713, and a control bar 714. The URL bar 711 may be used to display the current URL / website name, for example, including the characters "How to Study - Article Website 1", indicating that the current webpage is the "How to Study" webpage in Article Website 1. The website information 712 may include information such as the website name "Article Website 1", a website introduction, and a search box. The text 713 may be the text content in the current webpage, and may include the characters "First, it is very important to understand yourself, especially your strengths and weaknesses. Only by understanding your own situation can you find the right learning strategy. Second, manage your time and life. It is so common for students to deal with many things at the same time, then priority should be given to the things that are related to your goal." The control bar 714 may include multiple functional controls, such as a control for returning to the previous web page, a control for jumping to the next web page, a control for jumping to the homepage of the browser application, a control for viewing the window of the browser application, a control for viewing more information, etc. The electronic device 100 may receive a user operation on part or all of the text in the text 713, such as a touch operation, such as a long press operation and a slide operation. In response to the user operation, part or all of the text in the text 713 is selected. FIG. 7 takes the selection of part of the text in the text 713 as an example for explanation, and at this time, the user interface 720 shown in FIG. 7 (B) may be displayed.

[0154] As shown in FIG7(B), user interface 720 is similar to user interface 710, except that text 721 ("You can find the right learning strategy based on your own situation. Second, manage your time and life.") in text 713 displayed in user interface 720 is selected, and user interface 720 also includes a function bar 722. Function bar 722 may include multiple function controls, such as a copy control (for copying text 721), a select all control (for selecting all text on the current webpage, such as setting text 713 to a selected state), a search control (for searching text 721 on other websites), a translation control 722A, and a share control (for sharing text 721). Electronic device 100 may receive a user operation on translation control 722A, such as a touch operation, such as a single click operation. In response to the user operation, electronic device 100 may translate the selected text (i.e., text 721) into text in the target language (in FIG7 , Chinese is used as the default language for illustration), and then may display user interface 730 shown in FIG7(C).

[0155] As shown in FIG7 (C), user interface 730 is similar to user interface 710, except that user interface 730 further includes a translation box 731, which may include a title 731A (including the character "Translate"), a close control 731B, source language information 731C, target language information 731D, source text 731E, translated text 731F, and multiple functional controls. Source language information 731C may display "Auto Detect," indicating that electronic device 100 automatically detects the language of the source text when performing translation, and target language information 731D may be used to display a default or user-selected target language ("Chinese"). Source text 731E has the same content as selected text 721 in user interface 720, including Chinese text and English text. The Chinese text and English text are displayed differently, with the English text "Second, manage your time and life." being highlighted (e.g., highlighted). The translated text 731F is a text in the target language (i.e., Chinese) obtained by translating the source text 731E, "You can only find the correct learning strategy according to your own situation. Second, manage your time and life.", wherein "Second, manage your time and life." is the translation result of the English text in the source text 731E, and the translation result is in a highlighted (e.g., highlighted) state. Multiple functional controls include, for example, control 731G, control 731H, control 731I, and control 731J. Control 731G is used to copy the translated text 731F, control 731H is used to copy the translation result of the English text in the translated text 731F (i.e., "highlighted translation"), control 731I is used to share the translated text 731F, and control 731J is used to share the translation result of the English text in the translated text 731F (i.e., "highlighted translation").

[0156] Not limited to the above examples, in other examples, the electronic device 100 can also display the languages ​​included in the detected source text. For example, the source language information 511A in the user interface 520 shown in (B) of Figure 5 displays "English + German", indicating that the electronic device 100 detects that the source text displayed in the input box 512 includes content in both English and German.

[0157] Not limited to the above examples, in other examples, the electronic device 100 can also provide auxiliary interactive functions such as one-click copying, saving, and forwarding for the translation results. The controls for implementing these functions are similar to the copy control 521, save control 522, and forwarding control 523 in the user interface 520 shown in (B) of Figure 5, and will not be repeated here.

[0158] Not limited to the above examples, in other examples, the electronic device 100 may not display controls for copying / saving / forwarding the content in the language of interest, such as the copy control 521, save control 522, and forward control 523 shown in FIG5(B), the control 641H and control 641J shown in FIG6(D), and the control 731H and control 731J shown in FIG7(C), but may trigger the copying / saving / forwarding of the content in the language of interest in other ways, for example, when the electronic device 100 detects that the cursor is located at the location of the highlighted translation result (herein referred to as highlighted text) (for example, when the user is detected The touch position of the finger is located at the location of the highlighted text, or the cursor corresponding to the mouse or stylus pen connected to the electronic device 100 is detected to be located at the location of the highlighted text), the electronic device 100 can display a prompt message, which is used to prompt the user to copy, save and / or forward by selecting / selecting the highlighted text. The user can select the highlighted text based on the prompt message. When the electronic device 100 subsequently detects the user operation for selecting the highlighted text, it can display a copy control, a save control and / or a forwarding control. The specific instructions are similar to the instructions for displaying the function bar 722 when the text 721 is selected as shown in Figure 7.

[0159] Based on the above embodiments, the translation method involved in this application is introduced. The method can be applied to the electronic device 100 shown in Figure 1. The method can be applied to the electronic device 100 shown in Figure 2. The method can be applied to the electronic device 100 shown in Figure 3.

[0160] Please refer to Figure 8, which is a flowchart of a translation method provided in an embodiment of the present application. The method may include but is not limited to the following steps:

[0161] S101: The electronic device obtains a source text input by a user.

[0162] In one embodiment, the electronic device may obtain source text input by the user, or source text selected by the user from text displayed on the electronic device. For a specific example, see the description of S201 in FIG. 9 below.

[0163] S102: The electronic device determines whether the source text includes content in multiple languages.

[0164] In one embodiment, the electronic device can identify the language of the source text and obtain a language detection result. For the specific identification process, see the description of the multi-granularity language detection system 210 shown in Figures 3 and 4. Based on the language detection result, the electronic device can determine whether the source text includes content in multiple languages, that is, whether the source text is mixed-language. If the determination result is no, that is, the source text includes content in only one language (also referred to as the source text is single-language), the electronic device can execute S103. If the determination result is yes, the electronic device can intelligently identify content in the source text in a language that the user may be interested in / required (also referred to as content in the language of interest) based on the language detection result, for example, by executing S104 and S107.

[0165] S103: The electronic device translates the source text and displays the translation result.

[0166] In one embodiment, when the source text includes content in only one language, the electronic device can use a translation model corresponding to that language to translate the source text and obtain the output of the translation model, i.e., the translation result in the target language. The target language can be preset by the electronic device or determined in response to a user operation, such as a user operation on the target language information 511B in the user interface 510 shown in FIG5(A).

[0167] S104: The electronic device determines whether the source text includes content in the target language.

[0168] In one embodiment, the electronic device can determine whether the source text includes content in the target language based on the acquired language detection result. When the judgment result is yes, the electronic device can determine that the content in at least one language other than the target language in the source text is content in a language that the user may be interested in / required (i.e., the language of interest content), and translate the language of interest content, for example, executing S105-S106. When the judgment result is no, the electronic device can execute other steps to identify the language of interest content, for example, executing S107.

[0169] S105: The electronic device translates the non-target language content in the source text and obtains text 1.

[0170] In one embodiment, the source text may include content in the target language and content in at least one other language (referred to as a non-target language) other than the target language. Text 1 may include the translation results of the content in the at least one other language, i.e., the translation results of the content in the language of interest. In some examples, the non-target language content may include content in multiple languages. For any of these multiple languages, the electronic device may use the translation model corresponding to that language to translate the content in that language and obtain an output translation result. Text 1 includes the translation results of the content in these multiple languages.

[0171] S106: The electronic device displays the text 1 using a first display mode, and displays the target language content in the source text using a second display mode.

[0172] In one embodiment, the electronic device displays text 1 and the target language content in the source text according to the arrangement of characters in the source text, wherein text 1 and the target language content in the source text are displayed differently, for example, text 1 (i.e., the translation result of the content in the language of interest) is highlighted.

[0173] In one embodiment, the electronic device can display the source text and the translation result of the source text (including text 1 and the target language content in the source text), wherein the non-target language content in the source text is displayed in the same manner as text 1, for example, the non-target language content is highlighted in the source text, and text 1 is highlighted in the translation result of the source text.

[0174] S107: The electronic device determines whether the source text includes content in a preset language.

[0175] In one embodiment, the preset language is a minority language classified on the Internet, such as languages ​​other than Chinese, English, French, Spanish, Russian, and Arabic. However, the preset language may also be a minority language determined by other classification methods on the Internet. For example, languages ​​other than English are all classified as minority languages, and this application does not limit this.

[0176] In another embodiment, the preset language is selected by the electronic device from the acquired language detection results (including multiple languages) according to preset rules. In some examples, based on the country where the electronic device is located, a language other than the common language of the country (for example, the common language in China is Chinese) can be selected from the acquired language detection results as the preset language. Not limited to this, in other examples, based on the versatility of the language, the least versatile language can be selected from the acquired language detection results as the preset language. This application does not limit this.

[0177] In one embodiment, the electronic device can determine whether the source text includes content in a preset language based on the acquired language detection result. When the judgment result is yes, the electronic device can determine that the content in the preset language in the source text is content in a language that the user may be interested in / required (i.e., content in the language of interest), and translate the content in the language of interest, for example, executing S108-S109. When the judgment result is no, the electronic device can execute S110.

[0178] S108: The electronic device translates the content of the source text in the preset language to obtain text 2, and translates the content of the source text in a language other than the preset language to obtain text 3.

[0179] In one embodiment, for content in any language of a source text, the electronic device can use a translation model corresponding to that language to translate the content in that language and obtain an output translation result. The electronic device then recombines the obtained translation results of the content in multiple languages, i.e., arranges and combines them according to the arrangement of characters in the source text, to obtain a translation result (which may be referred to as a target text) that is consistent with the format of the source text. The target text includes the translation result of the content in the preset language (i.e., text 2) and the translation result of the content in at least one other language other than the preset language (collectively referred to as text 3).

[0180] S109: The electronic device displays text 2 using the third display mode, and displays text 3 using the fourth display mode.

[0181] In one embodiment, the electronic device may display the target text (ie, the translation result of the source text), wherein text 2 and text 3 are displayed in different ways, for example, text 2 is highlighted.

[0182] In one embodiment, the electronic device can display the source text and the translation result of the source text (including text 2 and text 3), wherein the content of the preset language in the source text and text 2 are displayed in the same manner, for example, the content of the preset language is highlighted in the source text, and text 2 is highlighted in the translation result of the source text.

[0183] S110: The electronic device translates the source text and displays the translation result.

[0184] In one embodiment, for content in any language of a source text, the electronic device can use the translation model corresponding to that language to translate the content in that language and obtain an output translation result. The electronic device then recombines the obtained translation results of the content in multiple languages, that is, arranges and combines them according to the arrangement of characters in the source text to obtain a translation result consistent with the format of the source text. When the electronic device displays the translation results, the translation results of content in different languages ​​are displayed in the same manner.

[0185] In some examples, the application scenario of the method shown in FIG8 is the scenario shown in FIG5, wherein the source text is the text displayed in the input box 512 shown in the user interface 520 (He turned around and asked: "EntschuldigenSie, sprechen Sie Deutsch?" but passersby ignored him and walked straight ahead.), the language detection results of the source text are English and German, and the target language of the translation is Chinese. Therefore, when executing the process shown in FIG8, the judgment result of S102 is yes, and the judgment result of S104 is no. At this time, the electronic device will execute S107. Assuming that the preset language is German, a minority language, the judgment result of S107 is yes, and the electronic device can translate the German text in the source text ("EntschuldigenSie, sprechen Sie Deutsch?") is identified as the language of interest, and an example of the electronic device displaying the translation result of the source text (i.e., the target text) can be seen in the display box 514 shown in the user interface 520, wherein the translation result of the German text ("Excuse me, do you speak German?") (i.e., Text 2) is highlighted, and the translation result of the English text (i.e., Text 3) is not highlighted.

[0186] In some examples, the application scenario of the method shown in FIG8 is the scenario shown in FIG6, wherein the source text is the text 623C ( account: Region: Hubei Wuhan), the language detection results of the source text are Chinese and Korean, and the target language of the translation is Chinese. Therefore, when executing the process shown in Figure 8, the judgment result of S102 is yes, and the judgment result of S104 is yes, then the electronic device will execute S105, and the electronic device will translate the Korean text in the source text ( and ) is identified as the content in the language of interest and translated, and the Chinese text in the source text is not translated. An example of an electronic device displaying the translation result of the source text (i.e., the target text) can be seen in the translation text 641F shown in the user interface 640, wherein the translation result of the Korean text ("Little Sister" and "Lucky Comes") (i.e., text 1) is highlighted, and the Chinese text (i.e., the content in the target language in the source text) is not highlighted.

[0187] In some examples, the application scenario of the method shown in FIG8 is the scenario shown in FIG7 , and the specific description is similar to the description of the above application scenario being the scenario shown in FIG6 , and reference can be made to the above description and the description of FIG7 .

[0188] In the method shown in FIG8 , when the source text is in a mixed language, the electronic device can intelligently identify the language of interest content that the user may be interested in / need, such as content in a non-target language or content in a minority language, from the source text based on the language detection results, and highlight the language of interest content when displaying the translation results of the source text, thereby further mining and utilizing the language detection results, allowing the user to quickly obtain the translation results of the required language content, and realizing the "language dimension" translation search-free function, which greatly facilitates user use.

[0189] Please refer to Figure 9, which is a flowchart of another translation method provided in an embodiment of the present application. The method may include but is not limited to the following steps:

[0190] S201: The electronic device receives a first input operation from a user.

[0191] S202: The electronic device displays the first text and the second text in response to the first input operation.

[0192] In one embodiment, the electronic device may obtain a source text to be translated according to a first input operation, where the source text includes a first text and a second text.

[0193] In some examples, the first input operation includes the user entering source text in an input box of the translation application interface, and the electronic device can display the source text in the input box of the translation application interface. For example, in the scenario shown in Figure 5, the electronic device can first receive the text entered into the input box 512 in the user interface 510 and display the user interface 510. The text displayed in the input box 512 in the user interface 510 is the first text and the second text.

[0194] In other examples, the first input operation includes the user selecting text on the instant messaging application interface. For example, in the scenario shown in Figure 6, the electronic device can first receive a user operation on the user interface 610 (such as a two-finger press operation), and in response to the user operation, extract part of the text in the user interface 610 and display a pop-up box: display box 623, in which the above-mentioned extracted text 623C is displayed, and text 623C is the first text and the second text.

[0195] In other examples, the first input operation includes the user selecting specific text (i.e., source text) in the text on the browser application interface. For example, in the scenario shown in Figure 7, the electronic device can receive a user operation (e.g., a long press operation) on a portion of the text 713 shown in the user interface 710. In response to the user operation, the user interface 720 is displayed, and the text 721 in the text 713 shown in the user interface 720 (i.e., the portion of the text selected by the user above) is selected, and the text 721 is the first text and the second text.

[0196] S203: The electronic device receives a first translation request from the user.

[0197] In one embodiment, the first translation request may be used to trigger the translation of the source text.

[0198] In some examples, the first input operation includes a user entering text in an input box of a translation application interface, and the electronic device receives a first translation request, including: the electronic device receives a user operation on a translation control in the translation application interface, for example, in the scenario shown in Figure 5, the electronic device receives a user operation on a translation control 513 in the user interface 510.

[0199] In other examples, the first input operation includes a user selecting text on an instant messaging application interface. The electronic device may display a pop-up box in response to the first input operation, and the pop-up box includes a first text, a second text, and a translation control. The electronic device receives a first translation request, including: the electronic device receives a user operation on the translation control in the pop-up box. For example, in the scenario shown in Figure 6, the electronic device may first receive a user operation on the text 623C in the display box 623 (i.e., the pop-up box) shown in the user interface 620, and in response to the user operation, select text 623C (i.e., the first text and the second text). At this time, the user interface 630 may be displayed, and then the user operation on the translation control 623G in the display box 623 shown in the user interface 630 is received.

[0200] In other examples, the first input operation includes a user selecting specific text in the text on the browser application interface, and the electronic device may display multiple function controls in response to the first input operation. The electronic device receives a first translation request, including: the electronic device receives a user operation on a translation control among the multiple function controls. For example, in the scenario shown in Figure 7, the electronic device receives a user operation on a translation control 722A in a function bar 722 (including multiple function controls) shown in the user interface 720.

[0201] In one embodiment, the electronic device may first determine whether the source text includes texts in multiple languages ​​based on the received first translation request. For a specific process example, see the description of S102 in Figure 8. Figure 9 illustrates an example in which the source text includes a first text in a first language and a second text in a second language (the first language and the second language are different). In a specific implementation, the source text may include texts in more languages ​​or fewer languages.

[0202] In one embodiment, when the electronic device determines that the source text includes texts in multiple languages, the electronic device can obtain word-level language detection results. The specific acquisition process can be seen in the description of Figures 3 and 4. The word-level language detection results can include the above-mentioned multiple languages, and the above-mentioned multiple languages ​​include a first language and a second language. The word-level language detection results can be used by the electronic device to determine the display mode of the translation results of the source text, that is, the first interface shown in S204 below is determined based on the word-level language detection results. In some examples, the electronic device can determine the first text in the first language from the texts in these multiple languages ​​according to preset rules. It can be understood as identifying the language of interest content that the user may be interested in / need. For specific implementation examples, see the description of S104 and S107 in Figure 8. The display mode of the translation results of the language of interest content and the translation results of other source texts can be different. Optionally, the display mode of the language of interest content and other source texts can also be different.

[0203] In one embodiment, after the electronic device determines that the source text includes text in multiple languages, it can use corresponding translation models to translate the text in the multiple languages ​​in the source text and obtain a target text in a third language (i.e., the target language). The target text includes a third text and a fourth text. The third text corresponds to the first text and is obtained by translating the first text. The fourth text corresponds to the second text.

[0204] In some examples, when the second language is the same as the third language, the fourth text is the same as the second text, that is, the electronic device does not translate the second text in the third language in the source text. The first language is different from the third language. For specific instructions, please refer to the description of S104-S106 in Figure 8.

[0205] In other examples, when the second language is different from the third language, the fourth text is obtained by translating the second text, and the first language is a preset language. For details, please refer to the description of S107-S109 in Figure 8.

[0206] S204: The electronic device displays a first interface (the first interface includes a third text corresponding to the first text and a fourth text corresponding to the second text).

[0207] In one embodiment, after the electronic device obtains the translation result of the source text (i.e., the target text), it can display a first interface, which includes a third text and a fourth text. The display mode of the third text is different from the display mode of the fourth text. For specific examples, please refer to the description of S106 and S109 in Figure 8. Optionally, the first interface also includes the first text and the second text, and the display mode of the first text is the same as the display mode of the third text, and the display mode of the second text is the same as the display mode of the fourth text.

[0208] In some examples, in the scenario shown in FIG5 , the text displayed in the input box 512 shown in the user interface 510 is the source text, the third language is Chinese, and the source text includes a German text (i.e., a first text in the first language) and an English text (i.e., a second text in the second language). In this case, the second language and the third language are different, so the fourth text is translated from the second text. The first interface can be seen in the user interface 520 shown in FIG5(B), wherein the input box 512 in the user interface 520 displays the source text, and the German text 512A (i.e., the first text) therein is highlighted, and the other text therein (i.e., the English text, i.e., the second text) therein is not highlighted. The display box 514 in the user interface 520 displays the target text, and the translation result 514A (i.e., the translation result of the first text, i.e., the third text) therein is highlighted, and the other text therein (i.e., the translation result of the second text, i.e., the fourth text) therein is not highlighted.

[0209] In some examples, in the scenario shown in FIG6 , the text 623C shown in the user interface 630 is the source text, the third language is Chinese, and the source text includes a Korean text (i.e., the first text in the first language) and a Chinese text (i.e., the second text in the second language). In this case, the second language and the third language are the same, so the fourth text and the second text are the same. The first interface can refer to the user interface 640 shown in (D) of FIG6 , wherein the user interface 640 displays a source text 641E and a translated text 641F (i.e., the target text), and the Korean text ( and ) (i.e., the first text) is highlighted, the Chinese text in the source text 641E ("Account: " and "Region: Hubei Wuhan Settings") (i.e., the second text) is not highlighted, and the "Little Sister" and "Lucky Comes" in the translated text 641F (i.e., the translation result of the first text, i.e., the third text) are highlighted, and the other texts in the translated text 641F (i.e., the fourth text corresponding to the second text, i.e., the second text) are not highlighted. The description of the scene shown in Figure 7 is similar to that of the scene shown in Figure 6 and will not be repeated here.

[0210] In one embodiment, the first interface further includes information of the first language and the second language, and optionally a third language, so that the user can intuitively obtain the language detection result of the source text and the target language.

[0211] In one embodiment, the first interface also includes a first control, which is used to perform at least one of the following functions: copying the third text, saving the third text, and forwarding the third text. For specific examples, see the copy control 521, save control 522, and forward control 523 in the user interface 520 shown in (B) of Figure 5, the control 641H and control 641J shown in (D) of Figure 6, and the control 731H and control 731J shown in (C) of Figure 7.

[0212] In the method shown in FIG9 , for a source text including content in multiple languages, the electronic device translates the texts in these multiple languages ​​separately to obtain a target text, that is, the translation result corresponding to the mixed-language source text can be obtained quickly and accurately. Furthermore, when displaying the target text, the electronic device can use different display methods for the translation results of source texts in different languages, such as highlighting the translation result (i.e., the third text) of the recognized content in the language of interest (i.e., the first text). The user no longer needs to compare the source text and the target text character by character, thus realizing the "language dimension" search-free function and improving the user experience.

[0213] The above embodiments are explained using the translation scenario as an example. In other embodiments, they can also be applied to voice broadcast scenarios. The difference is that the "translation model" needs to be replaced with the "voice broadcast model". Any voice broadcast model is used to obtain the pronunciation of the content in the corresponding language, and "display" needs to be replaced with "play". The specific instructions are similar and will not be repeated here.

[0214] The methods provided in the various embodiments of the present application may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, they may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital video disc (DWD), or a semiconductor medium (e.g., a solid state drive (SSD)). As mentioned above, the above embodiments are only used to illustrate the technical solutions of the present application, and are not intended to limit the same. Although the present application has been described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments may be modified, or some of the technical features thereof may be replaced by equivalents. However, such modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A translation method, characterized in that: Applied to electronic equipment, the method comprises: receiving a first input operation from a user; In response to the first input operation, display a first text and a second text, wherein the first text is in a first language, the second text is in a second language, and the first language is different from the second language; receiving a first translation request from the user; A first interface is displayed, wherein the first interface includes a third text and a fourth text, wherein the third text and the fourth text are in a third language, the third language is different from the first language, the third text is translated from the first text, the fourth text corresponds to the second text, and a display mode of the third text is different from a display mode of the fourth text.

2. The method according to claim 1, characterized in that in, When the second language is the same as the third language, the fourth text is the same as the second text; When the second language is different from the third language, the fourth text is obtained by translating the second text.

3. The method according to claim 1 or 2, characterized in that The first interface includes the first text and the second text. The display mode of the first text is the same as the display mode of the third text. The display mode of the second text is the same as the display mode of the fourth text.

4. The method according to any one of claims 1 to 3, characterized in that: The first interface includes information in the first language and the second language.

5. The method according to any one of claims 1 to 4, characterized in that: The first interface includes a first control, and the first control is used to perform at least one of the following functions: copying the third text, saving the third text, and forwarding the third text.

6. The method according to any one of claims 1 to 5, characterized in that: The receiving a first input operation of the user includes: The first input operation of the user is received on a second interface, wherein the second interface includes a first instant messaging application interface, and the first input operation includes selecting text on the first instant messaging application interface.

7. The method according to any one of claims 1 to 5, characterized in that: The receiving a first input operation of the user includes: The first input operation of the user is received on a third interface, wherein the third interface includes a first translation application interface, and the first input operation includes inputting the first text and the second text in an input box of the first translation application interface.

8. The method according to any one of claims 1 to 5, characterized in that: The receiving a first input operation of the user includes: The first input operation of the user is received on a fourth interface, wherein the fourth interface includes a first browser application interface, the first browser application interface includes a fifth text, and the first input operation includes selecting the first text and the second text in the fifth text.

9. The method according to any one of claims 1 to 8, characterized in that The third text in the first interface is in a highlighted state, and the first text corresponding to the third text is determined from the first text in the first language and the second text in the second language according to a preset rule.

10. The method according to any one of claims 1 to 9, characterized in that: The first language is a minority language.

11. The method according to any one of claims 1 to 10, characterized in that: After receiving the first translation request from the user, the method further includes: Processing the first text and the second text using a classifier to obtain first information, wherein the first information indicates that the first text and the second text are in mixed languages; A tagger is used to obtain the language of each symbol in the first text and the second text, and a word-level language detection result is obtained, wherein the word-level language detection result includes the first language and the second language, and the first interface is displayed according to the word-level language detection result.

12. An electronic device, characterized in that: The method comprises a transceiver, a processor and a memory, wherein the memory is used to store a computer program, and the processor calls the computer program to execute the method according to any one of claims 1 to 11.

13. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.

Citation Information

Patent Citations

  • Machine translation method and device

    CN106383818A

  • Text translation method and device, electronic equipment and storage medium

    CN111931517A

  • Page display method and device, computer equipment and storage medium

    CN113900762A

  • Method and system for providing translation for conference assistance

    US20210374362A1