Electronic device and machine translation method

By identifying and generating representative style information, the problem of inconsistent sentence styles in machine translation is solved, and a more natural translation effect is achieved.

CN120283236APending Publication Date: 2025-07-08SAMSUNG ELECTRONICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380079406.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-11-16
Filing Date
2023-08-03
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

Existing machine translation techniques have difficulty maintaining the natural tone and style consistency of sentences, especially when translating texts of multiple sentences, it is difficult to convey the nuances and tone of the original text.

Method used

By identifying style information in the text, representative style information is generated and machine translation is performed based on this information, including generating style vectors and optimizing the translation process using a bundle search method to maintain style consistency between sentences.

Benefits of technology

It achieves the consistency of the original text style and tone in machine translation, providing higher quality translation results that can reflect the nuances and tone of the original text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120283236A_ABST
    Figure CN120283236A_ABST
Patent Text Reader

Abstract

The electronic device includes a memory to store at least one instruction, and a processor to execute the instructions to receive text in a first language, generate style information indicating a translation style to be applied to the text in the first language based on the text in the first language, and apply the style information to the text in the first language. And machine-translating the text of the first language into a text of a second language based on the generated style information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to an electronic device and a method for performing machine translation. Background Art

[0002] Machine translation may refer to using a computer to translate a natural language used by humans into another language.

[0003] In machine translation of related technologies, the translated sentences usually have an unnatural tone. Summary of the Invention

[0004] Technical Solution

[0005] An electronic device and a method for performing machine translation by maintaining the style of a sentence are provided.

[0006] Additional aspects will be set forth in part in the description which follows and in part will be obvious from the description, or may be learned by practice of the presented embodiments.

[0007] According to an aspect of the present disclosure, an electronic device may include: a memory configured to store instructions, and a processor configured to execute the instructions to receive text in a first language, generate style information indicating a translation style to be applied to the text in the first language based on the text in the first language, and machine translate the text in the first language into text in a second language based on the generated style information.

[0008] The text in the first language may include a plurality of sentences, and the processor may be configured to execute the instructions to generate style information based on the plurality of sentences, and the style information is commonly applied to machine translation of the plurality of sentences.

[0009] The processor may be configured to execute the instructions to: distinguish a first sentence in a first style and a second sentence in a second style based on a predetermined symbol or text layout included in the text in the first language, generate first style information to be applied to the first style and second style information to be applied to the second style, translate the sentence in the first style into the second language based on the first style information, and translate the sentence in the second style based on the second style information.

[0010] The text in the first language may include multiple sentences. The processor may be configured to execute instructions to generate style information by generating third style information for each of the multiple sentences and determining representative style information based on the third style information. And the processor may be configured to execute instructions to machine - translate the text in the first language by identifying the similarity between the representative style information and the third style information, translating sentences within a predetermined similarity range into the second language based on the representative style information, and translating sentences outside the predetermined similarity range into the second language based on fourth style information of the sentences outside the predetermined similarity range.

[0011] The generated style information may include a style vector indicating at least one of the degree of honorific, formality, colloquialism, informativeness, and persuasiveness.

[0012] The processor may be configured to execute instructions to determine the degree of honorific of the text in the first language based on words, final words, and idioms included in the text in the first language, and machine - translate the text in the first language into text in the second language based on the determined degree of honorific.

[0013] The processor may be configured to execute instructions to classify the type of the text in the first language based on the text in the first language, and generate style information based on the style of the classified type of the first language.

[0014] The processor may be configured to execute instructions to generate candidate sentences in the second language for each sentence included in the text in the first language, generate fifth style information for each of the candidate sentences in the second language, and determine one of the generated multiple candidate sentences as the text in the second language based on the fifth style information of each of the candidate sentences and sixth style information indicating the translation style.

[0015] The processor may be configured to execute instructions to determine multiple candidate words or phrases included in the text in the first language, identify the style vector of each of the multiple candidate words or phrases, and determine the words or phrases to be applied to the text in the first language by comparing the style vector of each of the multiple candidate words or phrases with the generated style information.

[0016] The text in the first language may include multiple paragraphs, each paragraph including multiple sentences, where the processor may be configured to execute instructions to generate style information in units of multiple paragraphs, and where the processor may be configured to execute instructions to machine - translate the text in the first language into the text in the second language based on the generated style information generated in units of multiple paragraphs.

[0017] The electronic device may include a display, and the processor may be configured to execute instructions to control the display to display the text in the second language.

[0018] The electronic device may include a communicator configured to receive text, and the processor may be configured to execute instructions to control the communicator to send the text in the second language to an external device that has sent the text in the first language to the electronic device.

[0019] According to an aspect of the present disclosure, a method of an electronic device may include: receiving text in a first language, generating style information indicating a translation style to be applied to the text in the first language based on the text in the first language, and machine - translating the text in the first language into the text in the second language based on the generated style information.

[0020] The text in the first language may include multiple sentences, generating style information may include generating first - style information for each of the multiple sentences and determining representative style information based on the first - style information, and machine - translation may include identifying the similarity between the first - style information of each of the multiple sentences and the representative style information, translating the sentences within a predetermined similarity range into the second language based on the representative style information, and translating the sentences outside the predetermined similarity range into the second language based on the second - style information of the sentences outside the predetermined similarity range.

[0021] The generated style information may include a style vector indicating at least one of a degree of honorifics, a degree of formality, a degree of colloquialism, a degree of informativeness, and a degree of persuasiveness.

[0022] The method may include determining the degree of honorifics of the text in the first language based on words, final words, and idioms included in the text in the first language, and machine - translating the text in the first language into the text in the second language based on the determined degree of honorifics.

[0023] The method may include classifying the type of the text in the first language based on the text in the first language, and generating style information based on the classified type of the text in the first language.

[0024] The method may include: generating candidate sentences in a second language for each sentence included in the text in a first language, generating third style information for each candidate sentence among the candidate sentences in the second language, and determining, based on the third style information for each candidate sentence among the candidate sentences and fourth style information indicating a translation style, one candidate sentence among the generated plurality of candidate sentences as the text in the second language.

[0025] The method may include determining a plurality of candidate words or phrases included in the text in the first language, identifying a style vector for each candidate word or phrase among the plurality of candidate words or phrases, and determining a word or phrase to be applied to the text in the first language by comparing the style vector for each candidate word or phrase among the plurality of candidate words or phrases with the generated style information.

[0026] According to an aspect of the present disclosure, a non-transitory computer-readable recording medium may store instructions that, when executed by at least one processor, cause the at least one processor to receive text in a first language, generate style information indicating a translation style to be applied to the text in the first language, and machine-translate the text in the first language into text in a second language based on the generated style information. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The above and other aspects, features, and advantages of certain embodiments of the present disclosure will become more apparent from the following description taken in conjunction with the drawings, in which:

[0028] Figure 1 is a diagram illustrating a machine translation operation according to one or more embodiments;

[0029] Figure 2 is a diagram illustrating a machine translation operation according to one or more embodiments;

[0030] Figure 3 is a block diagram illustrating a configuration of an electronic device according to one or more embodiments;

[0031] Figure 4 is a block diagram illustrating a configuration of an electronic device according to one or more embodiments;

[0032] Figure 5 is a diagram illustrating a machine translation operation according to one or more embodiments;

[0033] Figure 6 is a diagram illustrating a method of generating style information for a machine translation to be applied to text according to one or more embodiments;

[0034] Figure 7 is a diagram illustrating a machine translation operation based on generated style information according to one or more embodiments;

[0035] Figure 8 is a diagram showing an example of a generated machine translation result according to one or more embodiments;

[0036] Figure 9 is a flowchart showing a control method of another electronic device according to one or more embodiments; and

[0037] Figure 10 is a flowchart showing a machine translation method of an electronic device according to one or more embodiments. Detailed Description of the Embodiments

[0038] Hereinafter, example embodiments of the present disclosure will be described in detail with reference to the accompanying drawings. The same reference numerals are used for the same components in the drawings, and redundant descriptions thereof will be omitted. The embodiments described herein are example embodiments, and thus the present disclosure is not limited thereto and can be implemented in various other forms. Terms including technical or scientific terms used in the present disclosure may have the same meaning as commonly understood by those skilled in the art.

[0039] When describing the present disclosure, when it is determined that a detailed description of a known function or configuration related to the present disclosure may unnecessarily obscure the gist of the present disclosure, its detailed description will be omitted.

[0040] In addition, the following exemplary embodiments can be modified in several different forms, and the scope and spirit of the present disclosure are not limited to the following exemplary embodiments. On the contrary, these exemplary embodiments make the present disclosure thorough and complete, and are provided to fully convey the spirit of the present disclosure to those skilled in the art.

[0041] Terms used in the present disclosure are only used to describe specific exemplary embodiments and do not limit the scope of the present disclosure. Unless otherwise clearly specified in the context, the singular form is intended to include the plural form.

[0042] In the present disclosure, expressions such as "having", "may have", "including", "may include", etc. indicate the existence of corresponding features (e.g., numerical values, functions, operations, components such as parts), and do not exclude the existence of additional features.

[0043] In the present disclosure, expressions such as "A or B", "at least one of A or / and B", "one or more of A or / and B", etc. may include all possible combinations of the items listed together. For example, "A or B", "at least one of A and B", or "at least one of A or B" may indicate all of the following cases: 1) a case including at least one A, 2) a case including at least one B, or 3) a case including both at least one A and at least one B.

[0044] As used in the present disclosure, expressions such as "first", "second", "first", "second", etc. may indicate various components, regardless of the order and / or importance of the components, and will only be used to distinguish one component from other components, and do not limit the corresponding components.

[0045] When referring to any component (e.g., a first component) being coupled / connected to another component (e.g., a second component) (operatively or communicatively), it should be understood that any component can be directly coupled to another component or can be coupled to another component through another component (e.g., a third component).

[0046] On the other hand, when referring to any component (e.g., a first component) being "directly coupled" or "directly connected" to another component (e.g., a second component), it should be understood that no other component (e.g., a third component) may exist between any component and the other component.

[0047] The expression "configured (or set) to" used in the present disclosure may be replaced by the expressions "suitable for", "capable of...", "designed to", "adapted to", "manufactured to", or "able to" according to the circumstances. The term "configured (or set) to" may not necessarily mean "specially designed for" in hardware.

[0048] Conversely, the expression "a device configured to..." may mean that the device "is capable of..." together with other devices or components. For example, "a processor configured (or set) to perform A, B, and C" may represent a dedicated processor (e.g., an embedded processor) for performing the corresponding operations or a general-purpose processor (e.g., a central processing unit (CPU) or an application processor) that can perform the corresponding operations by executing one or more software programs stored in a memory device.

[0049] In an exemplary embodiment, a "module" or "unit" may perform at least one function or operation and is implemented by hardware or software or a combination of hardware and software. In addition, except for'modules' or 'units' that need to be implemented by specific hardware, multiple "modules" or multiple "units" may be integrated into at least one module and implemented by at least one processor.

[0050] The operations performed by modules, programs, or other components according to various embodiments may be executed in a sequential manner, a parallel manner, an iterative manner, or a heuristic manner, or at least some of the operations may be executed in a different order or omitted, or other operations may be added.

[0051] The various components and regions in the drawings are schematically drawn. Therefore, the technical spirit of the present disclosure is not limited by the relative sizes or intervals drawn in the drawings.

[0052] An electronic device according to one or more embodiments may include at least one of a smart phone, a tablet personal computer (PC), a desktop PC, a laptop PC, and a wearable device. Here, the wearable device may include at least one of an accessory type device (e.g., a watch, a ring, a bracelet, an anklet, a necklace, glasses, contact lenses, or a head-mounted device (HMD)), a single-piece fabric or clothing type circuit (e.g., an electronic garment), a body-attached type circuit (e.g., a skin pad or a tattoo), and a bio-implantable type circuit.

[0053] According to some embodiments, the electronic device may include at least one of a refrigerator, an air conditioner, a vacuum cleaner, an oven, a microwave oven, a washing machine, an air purifier, a set-top box, a home automation control panel, a security control panel, a media box (e.g., Samsung HomeSync™, Apple TV™, or Google TV™), a game console (e.g., Xbox™ or PlayStation™), an electronic dictionary, an electronic key, a camera, an electronic photo frame, etc. In addition to the above embodiments, the electronic device according to the present disclosure may be any device as long as it includes a display.

[0054] Hereinafter, embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement it.

[0055] Figure 1 is a diagram showing a machine translation operation according to one or more embodiments.

[0056] Reference Figure 1 , shows the original text 10 including a plurality of sentences and a translation area 20 for the original text.

[0057] Machine translation is a process of translating a source sentence displayed in a source language into another language (i.e., a target language) specified by a user.

[0058] Generally, when translating a text including a plurality of sentences, the machine translation operation may perform the translation work sentence by sentence. Therefore, the translation work is performed on a sentence-by-sentence basis, and thus, there are cases where the translation style may be different within a paragraph.

[0059] For example, as Figure 1 shown, referring to the translation area 20 of the same newspaper article, it can be seen that the first sentence and the second sentence have different levels of honorifics (or polite expressions). Specifically, it can be confirmed that the first sentence is translated into an honorific word in Korean, while the second sentence is translated into a language that does not have an honorific word in Korean.

[0060] In addition, when translating the original text into other languages, it is difficult to convey the nuances or tone of the original text.

[0061] Therefore, a method for reflecting the nuances, tone, etc. of the original text and a method for commonly applying the tone of the above voice during the translation of multiple sentences are needed.

[0062] Accordingly, the present disclosure provides a method for identifying the style of a sentence included in the original text when translating a sentence and performing translation based on the identified style.

[0063] Figure 2 FIG. is a diagram illustrating a machine translation operation according to one or more embodiments.

[0064] Reference Figure 2 , when receiving text in a first language, the electronic device (i.e., translator) 100 of the present disclosure identifies style information of the input text. The style information is a translation style applied to the text and may include a style vector indicating at least one of a degree of honorifics, formality, colloquialism, informativeness, and persuasiveness.

[0065] Specifically, the electronic device 100 may identify style information of each of multiple sentences in a paragraph to reflect a unified translation or style of the original text and determine representative style information to be used in the translation. For example, when the input text 101 includes two sentences 102 and 103, style vectors of each of the first sentence and the second sentence may be calculated, and a representative style vector commonly applied to the first sentence and the second sentence may be determined. In this case, an average value of the style vector of the first sentence and the style vector of the second sentence or a weighted average value (e.g., an average value reflecting weights according to the sentence order) may be used to determine the representative style vector.

[0066] Alternatively, the first sentence or a sentence designated by the user may be used, or representative style information to be applied to the corresponding text may be determined by identifying the type of the text. As described above, the style information may include multiple style vectors, and in implementation, may include only one style vector. Types of style vectors other than the illustrated style vectors may be used. An example of the style vector used in the present disclosure will be described later with reference to Figure 6 Describe an example of the style vector used in the present disclosure.

[0067] In this way, when determining the representative style information, the electronic device 100 may use the determined style information to perform machine translation in units of sentences 104 and 105. Referring to the example shown, since the translation work is performed using the determined style information, it can be confirmed that the translation results (i.e., the output sentences 104 and 105) also follow the representative style information. For example, it can be confirmed that the Out 1 style vector of the translation result for the first sentence 102 generated based on the style vector of the determined original paragraph estimates the representative style information, and the Out 2 style vector of the translation result for the second sentence 103 generated based on the style vector of the determined original paragraph also estimates the representative style information. A specific example of a translation operation will be described later with reference to Figure 7 Describe an example of a specific translation operation.

[0068] In this way, the electronic device 100 according to the present disclosure determines the style information and performs machine translation using the determined style information. Therefore, it is possible to perform a translation that maintains the style (tone, etc.) of the original text and maintains the corresponding style throughout the sentence.

[0069] Figure 1 and Figure 2 It is shown and described that text is directly received and machine translation is performed. However, in implementation, a web page or document including text may be received, and the above operations may be applied to the speech recognition result of speech data including speech issued by a user.

[0070] Although Figure 2 Four types of style vectors are shown, but in some embodiments, only some of the four style vectors may be used, and style vectors other than the above style vectors may be used. Additionally, in implementation, the style vector to be used for the corresponding sentence may be determined, and the corresponding style may be maintained only for the determined style vector.

[0071] Figure 3 is a block diagram showing the configuration of an electronic device according to one or more embodiments.

[0072] Refer to Figure 3 , the electronic device 100 may include a memory 110 and a processor 120.

[0073] The memory 110 is a component for storing an operating system (O / S), various software, data, etc. for driving the electronic device 100. The memory 110 may be implemented in various forms, such as random access memory (RAM), read only memory (ROM), flash memory, hard disk drive (HDD), solid state drive (SSD), external memory, memory card, etc., but is not limited thereto.

[0074] The memory 110 may store at least one instruction. Such instructions may include applications for performing the above machine translation or various applications corresponding to functions that can be executed by the electronic device 100.

[0075] The memory 110 may store text in a first language. Alternatively, the text in the first language may be stored in a separate memory. The text may be received directly from a user or may be a document such as a text, a web page, or a report used in various applications. Such text may include multiple sentences.

[0076] Although the text has been described as being used, vector values corresponding to the text may be used in an implementation. A predetermined encoding algorithm, such as a Bidirectional Encoder Representations from Transformers (BERT) natural language processing model, a Robustly Optimized BERT Pretraining Approach (RoBERTa) natural language processing model, a T5 natural language processing model, etc., may be used to generate the vector values. In an implementation, any algorithm other than the above algorithms may be used as long as the algorithm can convert the text into vector values for natural language processing.

[0077] The processor 120 may control each component of the electronic device 100. The processor 120 may be composed of a single device such as a central processing unit (CPU) and an application specific integrated circuit (ASIC) or multiple devices such as a CPU and a graphics processing unit (GPU).

[0078] When a machine translation command is received, the processor 120 may machine translate the input text in the first language into text in a second language.

[0079] Specifically, the processor 120 may generate style information indicating a translation style to be applied in the machine translation. In this case, the processor 120 may generate style information to be commonly applied to multiple sentences (i.e., style information for each of the multiple sentences), and may use an average value of each style vector in the calculated style information or a weighted average value.

[0080] Alternatively, the processor 120 may generate style information by identifying a translation style applied to the first sentence or a user-specified sentence among the multiple sentences. Such representative style information may be generated in units of paragraphs. In other words, when multiple paragraphs are included, the above operation of generating style information may be applied in units of paragraphs. In addition, the style information may be commonly applied to the entire text (i.e., multiple paragraphs) at the time of implementation.

[0081] The processor 120 may generate multiple style information instead of a single style information. Specifically, the processor 120 may distinguish a first sentence of a first style and a second sentence of a second style based on a predetermined symbol or text layout included in the text, and generate a first style information to be applied to the first style and a second style information to be applied to the second style. For example, in a paragraph written in a literary style, there are cases where the words of a specific user are written as they are.

[0082] Alternatively, the text may be according to the layout format of the speaker (e.g., Speaker 1: Text 1; and Speaker 2: Text 2). Speaker 1 may use short words, while Speaker 2 uses honorific words. In this case, if all sentences are unified with the same short words or honorific words, the translation may be inaccurate or have other problems. Therefore, in the above case, the text style may be applied separately.

[0083] In addition, in implementation, by comparing the above style information and the representative style information, multiple styles (in addition to or as an alternative to the above predetermined symbol and text layout) may be used. In other words, if the style information of the current sentence is similar to the representative style information, translation according to the representative style information may be performed. However, if there is a large difference between the style information of the current sentence and the representative style information, which may indicate that the author likely deliberately changed the writing style of the original text, the style information of the corresponding sentence may be used instead of the representative style information. Examples of this will be referred to later Figure 10 to describe such examples.

[0084] The processor 120 may machine - translate the text in the first language into the text in the second language using the generated style information. Specifically, the processor 120 may perform machine translation using the beam search method, and when calculating the score (e.g., probability) of the beam search method, the previously calculated representative style information may be used.

[0085] When there is multiple style information for a sentence, the processor 120 may translate the sentence of the first style into the text in the second language using the first style information, and translate the sentence of the second style into the text in the second language using the second style information.

[0086] The machine translation implementing the above style information may be performed in various ways. Specifically, the processor 120 may generate multiple candidate translations for a sentence, and determine the candidate translation corresponding to the style information among the candidate translations as the translation. Alternatively, during the process of generating the translation, machine translation may be performed by reflecting the style information during the process of generating each word or phrase. Examples of this will be referred to later Figure 6Describe such an operation.

[0087] Although Figure 3 only a simple configuration of the electronic device 100 is shown, the electronic device 100 may further include Figure 3 various components not shown in Figure 4 which will be described below with reference to

[0088] Figure 4 is a block diagram showing the configuration of an electronic device according to one or more embodiments.

[0089] Referring to Figure 4 , the electronic device 100 may include a memory 110, a processor 120, a communicator 130, a display 140, and an input device 150.

[0090] Since the memory 110 and the processor 120 have been described with reference to Figure 3 , a repetitive description may be omitted.

[0091] The communicator 130 may be configured to connect the electronic device 100 to an external device, and may be provided not only in a form in which it is connected to an external device through a local area network (LAN) and the Internet network, but also in a form in which it is connected through a universal serial bus (USB) port or a wireless communication (e.g., WiFi 802.11 a / b / g / n, near field communication (NFC), Bluetooth) port. Such a communicator 130 may be referred to as a transceiver.

[0092] The communicator 130 may receive text. Alternatively, the communicator 130 may receive content including the above text (e.g., a web page, a document, etc.). In addition, the above text may be the result of speech recognition.

[0093] The communicator 130 may send a translation result. For example, the electronic device 100 according to the present disclosure may be implemented as a server, and when a request for machine translation of a first language is received from an external device, may perform machine translation and send the result to the corresponding external device.

[0094] The display 140 may display a user interface window for receiving a selection of a function supported by the electronic device 100. Specifically, the display 140 may display a user interface window for receiving a selection of various functions provided by the electronic device 400. Such a display 430 may be a monitor such as a liquid crystal display (LCD), an organic light emitting diode (OLED), etc., or may be implemented as a touch screen capable of simultaneously performing some functions of the input device 150 described later.

[0095] The display 140 may display the machine translation result. In this case, the display 140 may display the original text and the machine translation result together.

[0096] The input device 150 may receive control commands regarding the functions of the electronic device 100 and the selection of corresponding functions. Such an input device 150 may be a keyboard, a mouse, a touchpad, etc., and may include a microphone for receiving user speech.

[0097] Although Figure 4 is further shown different components from Figure 3 the components (e.g., a display, a user input device), depending on the specific implementation, only some of the above components may be further included as needed or desired. Additionally, the electronic device 100 may further include Figure 4 components not shown in

[0098] Figure 5 is a diagram showing a machine translation operation according to one or more embodiments.

[0099] Referring to Figure 5 , including a style vector generation operation 510 and a machine translation operation 520.

[0100] First, in the style vector generation operation 510, representative style information to be used in the translation process may be determined. Specifically, style vectors regarding each sentence included in the text may be calculated, and a style vector state to be applied to the entire paragraph may be determined based on the calculated style vectors.

[0101] The style vector may be formality, politeness, informativeness, persuasiveness, etc. In an implementation, the above style vectors may be calculated for each sentence, and the type and degree value of the style vector to be applied to the entire paragraph may be calculated. For example, when a high honorific degree value is calculated throughout the sentence and other values are not so high, it may be determined that only the style vector for the honorific degree is applied. Additionally, the value to be applied to the determined style vector (the average value or weighted value of each sentence) may be determined.

[0102] Thus, when the representative style information is determined, machine translation may be performed by reflecting the determined style information in the machine translation operation 520. The method of reflecting such style information may be implemented in various ways. For example, multiple candidate translations may be generated during the translation process, and one candidate translation among the multiple candidate translations may be selected by comparing the style information of each translation among the multiple translations and the representative style information. Alternatively, translation may be performed considering the style vectors included in the style information, which will be described later with reference to Figure 7 below.

[0103] Figure 6 This is a diagram showing a method for generating style information of machine translation to be applied to text according to one or more embodiments.

[0104] Reference Figure 6 depicts four style vectors.

[0105] The first style vector is formality, which indicates the degree of honorific usage in a sentence. For example, the corresponding style vector can have different numerical values according to the degree of honorifics. As shown in the example, for the same sentence, there are sentences with different degrees of honorifics, and the degree of honorifics can be identified based on the words or predicates included in the sentence, and the corresponding value can be calculated.

[0106] The second style vector is politeness information, and it can have a higher value when the sentence is closer to a polite style and a lower value when the sentence is closer to an impolite style.

[0107] The third style vector is informativeness, which is a value indicating whether the corresponding sentence provides specific information. For example, a sentence providing objective information can have a high numerical value, and a sentence providing subjective opinions can have a low numerical value.

[0108] The fourth style vector is persuasiveness, which is a value indicating whether the corresponding sentence is a sentence for persuading multiple users. For example, a sentence for persuading others (such as a thesis, an editorial, etc.) can have a high numerical value. In this case, the corresponding vector can be represented as a value of 0 or 1.

[0109] Although the present disclosure shows four style vectors that can affect the style of a sentence, in implementation, in addition to the above-mentioned style vectors, other features can be used if they can affect the style of a sentence.

[0110] Although the style vectors are represented as vectors in the above description, the style vectors can be represented as numerical values. In other words, the above-mentioned style vectors can also be referred to as style factors, style values, style degrees, etc.

[0111] Thus, representative style information can be generated by calculating the above four style vectors for each sentence unit and using the style vectors of each sentence in multiple sentences to determine the degree of the style vector to be applied to the entire paragraph.

[0112] Although all four style vectors are shown and described above, in implementation, not all of the above-mentioned style vectors are used, and only some style vectors that are commonly applied to the corresponding paragraph can be determined and used. Alternatively, things other than the above four style vectors can be used as long as the style of the text can be specified.

[0113] In the above, it is described that style information is generated by calculating a style vector. However, in implementation, the writing type of the text can be recognized, and style information can be generated based on the recognized writing type. For example, editorials, manuals, newspaper articles, etc. have specific styles for each writing type. Therefore, style information corresponding to the writing type can be used. To recognize the writing type, a predetermined AI algorithm can be used, and the source of the text, etc. can also be used to recognize the writing type.

[0114] Figure 7 is a diagram showing a machine translation operation based on the generated style information according to one or more embodiments.

[0115] Figure 7 is a diagram showing the machine translation process for "Shall we go to dinner?" and "There will be a welcome speech." When these two sentences are input, a style classifier 511 can be used to recognize the style information 710 of each sentence, and representative style information to be commonly applied to the two sentences can be determined. For example, since a slightly formal or respectful sentence using "shall we..." is used, a style vector corresponding to the use of such a phrase can be calculated.

[0116] When such representative style information is calculated, a beam search method can be used to perform machine translation. The beam search method 730 can refer to a method of generating a translation while incrementally adding tokens one by one during the process of generating the translation. During the process of determining tokens, the probability (e.g., score) of each candidate of the corresponding token is used.

[0117] When calculating such a probability (or score), the above style vector is reflected. That is, the electronic device can compare similarity and correct probability at operation 720. For example, when determining "dinner" and there are candidates for the next token such as "to eat", "to have", and "wanna eat?" as Figure 7 shown, when calculating the probability (e.g., score) of each candidate, a candidate that matches the value corresponding to the style vector can be determined.

[0118] Therefore, the present disclosure describes a machine translation operation performed by a beam search method. However, in implementation, the machine translation operation can be performed by a method other than the beam search method.

[0119] Figure 8 is a diagram showing an example of the generated machine translation result according to one or more embodiments.

[0120] Figure 8 shows the text 810 in the first language and the machine translation result 820 of the corresponding text.

[0121] Refer to the machine translation results to confirm that the end words of each sentence maintain the same style, such as "decreased", "reported", and "did".

[0122] In this way, when performing machine translation according to the method of the present disclosure, the translation style between sentences is maintained, and thus the consistency within a paragraph can be maintained. In addition, since various styles (tone, speech, parlance, locution, etc.) included in the original text can be reflected, a higher-quality translation result can be provided.

[0123] Figure 9 It is a flowchart showing a control method of another electronic device according to one or more embodiments.

[0124] Refer to Figure 9 , in operation S905, text in a first language is received. Specifically, the text can be received from an external device, can be directly received through an input device provided in the electronic device 100, or can be received when pasting text applied to another application, etc.

[0125] Subsequently, in operation S910, representative style information indicating the translation style of the machine translation to be applied to the text in the first language is generated. For example, when the text includes multiple sentences, multiple sentences can be used to generate style information to be commonly applied to the multiple sentences. Alternatively, the style information can be generated by checking the translation style of the first sentence or a sentence specified by the user among the multiple sentences.

[0126] There are cases where the author intentionally writes sentences in different styles. For example, there may be cases where words of a specific speaker are quoted as they are (e.g., within punctuation such as ""), or there may be cases of script or movie lines. Therefore, even when the author intentionally distinguishes sentences with different styles, in order to perform translations corresponding to each style, if the sentence includes a predetermined symbol (e.g., ""), or there is a text layout in the form of "Name: Text", the sentences in the text can be divided into multiple sentences, and different style information can be generated for each divided sentence.

[0127] The style information can include a style vector indicating at least one of the degree of honorifics, formality, colloquialism, informativeness, and persuasiveness. Since the characteristics of each style vector have been described above, repeated descriptions will be omitted.

[0128] In operation S920, the text in the first language is machine-translated into the text in the second language using the generated style information. Specifically, during the process of translating words or phrases included in the text, multiple candidate words or phrases can be determined, the style vector of each candidate word or phrase can be identified, and the text in the first language can be translated into the text in the second language by comparing the style vector of each candidate word or phrase with the style information to determine the word or phrase to be applied to the text.

[0129] Subsequently, the machine translation result can be output in operation S930. Specifically, the machine translation result can be displayed or sent to an external device.

[0130] In this way, in the control method of the electronic device according to the present disclosure, machine translation can be performed while maintaining the translation style in the paragraph. Additionally, machine translation can be performed by maintaining the style (such as tone) of the original text.

[0131] Figure 10 is a flowchart showing a machine translation method of an electronic device according to one or more embodiments. Hereinafter, for ease of explanation, it is assumed that text including multiple sentences is input.

[0132] When text including multiple sentences is input, a style vector for each sentence is generated in operation S1010.

[0133] In operation S1030, a representative style vector (such as an average value, a weighted average value, convolution, etc.) can be generated. The style vector of the representative sentence can be used as the style information or the average value or weighted average value of the style vectors applied to each sentence can be used to determine the style information to be applied to the entire sentence. If only one sentence is included or the user designates a sentence, the style information of the corresponding sentence can be used as the representative style information.

[0134] In operation S1040, the determined style information to be applied to the entire sentence is compared with the style vector of each sentence.

[0135] In operation S1050, it can be determined whether the similarity is equal to or greater than a predetermined value. In operation S1060, if the difference between the two is less than the predetermined value (S1050 - Y) (that is, if the style vector applied to the current sentence is similar to the style information applied to the entire sentence), the translation using the style vector applied to the corresponding sentence can be performed.

[0136] In operation S1070, if the difference as a result of the comparison is equal to or greater than the predetermined value (S1050 - N), the translation can be performed based on the representative style information applied to the entire sentence rather than the style vector applied to the current sentence.

[0137] The term "~device" or "module" used in the present disclosure may include a unit configured by hardware, software, or firmware, and may be used compatibly with terms such as, for example, logic, logic block, component, circuit, etc. A "unit" or "module" may be a component or the smallest unit of an overall configuration that executes one or more functions or a part thereof. For example, a module may be configured by an application specific integrated circuit (ASIC).

[0138] Various embodiments of the present disclosure may be implemented by software including instructions stored in a machine-readable storage medium (e.g., a computer-readable storage medium). A machine is a device capable of calling the stored instructions from the storage medium and operating according to the called instructions, and may include an electronic device of the disclosed embodiments. In the case where the processor executes the above commands, the processor may directly execute the functions corresponding to the commands, or other components may execute the functions corresponding to the above commands under the control of the processor. The commands may include code created or executed by a compiler or an interpreter. The machine-readable storage medium may be provided in the form of a non-transitory storage medium. The term "non-transitory" may mean that the storage medium is tangible and does not include signals, and does not distinguish whether the data is stored semi-permanently or temporarily in the storage medium.

[0139] According to one or more embodiments, a method according to various embodiments disclosed in this document may be included and provided in a computer program product. The computer program product may be traded as a product between a seller and a buyer. The computer program product may be distributed in the form of a storage medium (e.g., a compact disc read-only memory (CD-ROM)), which may be read by a machine or read online through an application store (e.g., PlayStore TM )). In the case of online distribution, at least a part of the computer program product may be stored at least temporarily in a storage medium (such as the memory of a manufacturer's server, an application store's server, or a relay server) or generated temporarily.

[0140] Each of the components (e.g., modules or programs) according to the above various embodiments may include a single entity or multiple entities, and some of the corresponding sub-components above may be omitted, or other sub-components may be further included in various embodiments. Alternatively or additionally, some components (e.g., modules or programs) may be integrated into one entity and perform the same or similar functions as each corresponding component performed before integration. The operations performed by the modules, programs, or other components according to various embodiments may be performed in a sequential manner, a parallel manner, an iterative manner, or a heuristic manner, at least some operations may be performed in a different order or omitted, or other operations may be added.

[0141] The embodiments of the present disclosure disclosed in the specification and the drawings only provide specific examples to easily describe the technical content of the embodiments according to the present disclosure and to help understand the embodiments of the present disclosure, and are not intended to limit the scope of the embodiments of the present disclosure. Therefore, in addition to the embodiments disclosed herein, the scope of various embodiments of the present disclosure should be construed to cover all modifications or variations derived from the technical spirit of various embodiments of the present disclosure.

Claims

1. An electronic device, comprising: a memory configured to store instructions; and a processor configured to execute the instructions to: receive text in a first language; generate style information indicating a translation style to be applied to the text in the first language based on the text in the first language; and machine translate the text in the first language into text in a second language based on the generated style information.

2. The electronic device according to claim 1, wherein, The text in the first language includes a plurality of sentences, and wherein the processor is further configured to execute the instructions to generate style information based on the plurality of sentences, and the style information is commonly applied to the machine translation of the plurality of sentences.

3. The electronic device according to claim 2, wherein, The processor is further configured to execute the instructions to: distinguish a first sentence in a first style and a second sentence in a second style based on a predetermined symbol or text layout included in the text in the first language; generate first style information to be applied to the first style and second style information to be applied to the second style; translate the sentence in the first style into the second language based on the first style information; and translate the sentence in the second style into the second language based on the second style information.

4. The electronic device according to claim 1, wherein, The text in the first language includes a plurality of sentences, wherein the processor is configured to execute the instructions to generate style information by: generating third style information for each of the plurality of sentences; and determining representative style information based on the third style information; and wherein the processor is configured to execute the instructions to machine translate the text in the first language by: identifying the similarity between the representative style information and the third style information; translating sentences within a predetermined similarity range into the second language based on the representative style information; and translating sentences outside the predetermined similarity range into the second language based on fourth style information of the sentences outside the predetermined similarity range.

5. The electronic device according to claim 1, wherein The generated style information includes a style vector indicating at least one of a degree of honorifics, a degree of formality, a degree of colloquialism, a degree of informativeness, and a degree of persuasiveness.

6. The electronic device according to claim 1, wherein, The processor is further configured to execute the instructions to: determine the degree of honorifics of the text in the first language based on words, final words, and idioms included in the text in the first language; and machine translate the text in the first language into text in the second language based on the determined degree of honorifics.

7. The electronic device according to claim 1, wherein, The processor is further configured to execute the instructions to: classify the type of the text in the first language based on the text in the first language; and generate style information based on the classified type of the text in the first language.

8. The electronic device according to claim 1, wherein, The processor is further configured to execute the instructions to: generate candidate sentences in the second language for each sentence included in the text in the first language; generate fifth style information for each of the candidate sentences in the second language; and determine one of the generated candidate sentences as the text in the second language based on the fifth style information of each of the candidate sentences and sixth style information indicating the translation style.

9. The electronic device according to claim 1, wherein The processor is further configured to execute the instructions to: determine a plurality of candidate words or phrases included in the text in the first language; identify the style vector of each of the plurality of candidate words or phrases; and Words or phrases to be applied to the text in the first language are determined by comparing the style vectors of each of the plurality of candidate words or phrases with the generated style information.

10. The electronic device according to claim 1, wherein, The text in the first language includes a plurality of paragraphs, and each paragraph includes a plurality of sentences. Wherein, the processor is configured to execute instructions to: generate style information in units of the plurality of paragraphs; and Wherein, the processor is configured to execute instructions to: machine-translate the text in the first language into the text in the second language based on the generated style information generated in units of the plurality of paragraphs.

11. The electronic device according to claim 1, further comprising: A display Wherein, the processor is further configured to execute instructions to control the display to display the text in the second language.

12. The electronic device according to claim 1, further comprising: A communicator configured to receive text Wherein, the processor is further configured to execute instructions to control the communicator to send the text in the second language to an external device that has sent the text in the first language to the electronic device.

13. A method for an electronic device, comprising: Receiving the text in the first language; Generating style information indicating the translation style to be applied to the text in the first language based on the text in the first language; and And Machine-translating the text in the first language into the text in the second language based on the generated style information.

14. The method according to claim 13, wherein, The text in the first language includes a plurality of sentences. Wherein, generating style information includes: Generating first style information for each of the plurality of sentences; and Determining representative style information based on the first style information, and Wherein, machine translation includes: Identifying the similarity between the first style information and the representative style information of each of the plurality of sentences; Translating the sentences within a predetermined similarity range into the second language based on the representative style information; and Translating the sentences outside the predetermined similarity range into the second language based on the second style information of the sentences outside the predetermined similarity range.

15. A non-transitory computer-readable recording medium storing instructions, which when executed by at least one processor cause the at least one processor to: Receive the text in the first language; Generate style information indicating the translation style to be applied to the text in the first language; and Machine-translate the text in the first language into the text in the second language based on the generated style information.