KR20220044011A - Method and system for text style transfer, and learning method for implementing same - Google Patents

Method and system for text style transfer, and learning method for implementing same Download PDF

Info

Publication number
KR20220044011A
KR20220044011A KR1020200126671A KR20200126671A KR20220044011A KR 20220044011 A KR20220044011 A KR 20220044011A KR 1020200126671 A KR1020200126671 A KR 1020200126671A KR 20200126671 A KR20200126671 A KR 20200126671A KR 20220044011 A KR20220044011 A KR 20220044011A
Authority
KR
South Korea
Prior art keywords
style
text
embedding
vector
latent
Prior art date
Application number
KR1020200126671A
Other languages
Korean (ko)
Other versions
KR102417036B1 (en
Inventor
손경아
김희진
Original Assignee
아주대학교산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 아주대학교산학협력단 filed Critical 아주대학교산학협력단
Priority to KR1020200126671A priority Critical patent/KR102417036B1/en
Publication of KR20220044011A publication Critical patent/KR20220044011A/en
Application granted granted Critical
Publication of KR102417036B1 publication Critical patent/KR102417036B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/247Thesauruses; Synonyms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Abstract

According to one aspect according to the technical idea of the present disclosure, provided is a method for converting a text style, which includes the steps of: obtaining input text; obtaining, through an encoder, a latent representation for the obtained input text; obtaining the style embedding corresponding to a target style through a style embedding model; coupling the obtained style embedding to the latent representation; and obtaining, via the decoder, output text for the combined latent representation.

Description

텍스트 스타일 변환 방법 및 시스템, 및 이의 구현을 위한 학습 방법{METHOD AND SYSTEM FOR TEXT STYLE TRANSFER, AND LEARNING METHOD FOR IMPLEMENTING SAME}Text style transformation method and system, and learning method for its implementation

본 개시(disclosure)의 기술적 사상은 텍스트 스타일 변환 방법 및 시스템, 및 이의 구현을 위한 학습 방법에 관한 것이다.The technical idea of the present disclosure relates to a text style conversion method and system, and a learning method for implementing the same.

텍스트 스타일 변환은 지정된 스타일 속성으로 텍스트를 수정하는 태스크이다. 특정 스타일(예컨대, 긍정)을 갖는 입력 텍스트가 주어지면, 텍스트 스타일 변환은 다른 스타일(예컨대, 부정)을 얻기 위해 상기 입력 텍스트를 변경하는 것을 목표로 한다. Text style conversion is the task of modifying text with specified style attributes. Given input text having a particular style (eg positive), text style transformation aims to change the input text to obtain a different style (eg negative).

이러한 텍스트 스타일 변환에 있어서, 주어진 목표 스타일을 반영하고, 스타일과 무관한 부분의 내용을 유지하고, 자연스러운 문장을 생성하는 것이 중요하다.In this text style conversion, it is important to reflect the given target style, maintain the content of parts that are not related to the style, and generate natural sentences.

종래의 방식에 따르면, 텍스트 스타일 변환을 위한 모델은 소스 문장 및 목표 문장 쌍을 포함하는 병렬 데이터 세트를 사용하는 지도 학습 방법을 활용하여 제공되었다. 그러나, 이러한 방식은 지정된 스타일과 전체적으로 일대일 대응을 달성하는 병렬 데이터 세트를 획득하는 것이 불가능할 수 있다.According to the conventional method, a model for text style transformation was provided using a supervised learning method using a parallel data set including a pair of source sentences and target sentences. However, this approach may make it impossible to obtain parallel data sets that achieve a one-to-one correspondence with a given style as a whole.

또한, 입력 텍스트 내에서 스타일 구성 요소와 내용 구성 요소를 분리하려는 분리 접근 방식이 연구되고 있으나, 상기 구성 요소들이 상호 배타적이지 않으므로 문장을 스타일 구성 요소와 내용 구성 요소로 나누는 것이 어려울 수 있다. 또한 이러한 분리는 정보의 손실을 유발할 우려가 있다.In addition, a separation approach to separate the style component and the content component within the input text is being studied, but it can be difficult to divide the sentence into the style component and the content component since the components are not mutually exclusive. In addition, such separation may cause loss of information.

본 발명이 해결하고자 하는 일 과제는, 텍스트 스타일 변환 시 문장 복원 능력 및 스타일의 정확성을 향상시키는 방법 및 시스템을 제공하는 것이다.SUMMARY OF THE INVENTION An object of the present invention is to provide a method and system for improving sentence restoration ability and style accuracy when converting text styles.

본 발명이 해결하고자 하는 일 과제는, 스타일의 강도를 반영하여 입력 텍스트의 스타일을 변환할 수 있는 방법 및 시스템을 제공하는 것이다.An object of the present invention is to provide a method and system capable of converting the style of input text by reflecting the strength of the style.

상기와 같은 목적을 달성하기 위하여, 본 개시의 기술적 사상에 의한 일 양태(aspect)에 따른 텍스트 스타일 변환 방법은, 입력 텍스트를 획득하는 단계; 인코더를 통해, 획득된 입력 텍스트에 대한 잠재 표현을 획득하는 단계; 스타일 임베딩 모델을 통해, 타겟 스타일에 대응하는 스타일 임베딩을 획득하는 단계; 획득된 스타일 임베딩을 상기 잠재 표현에 결합하는 단계; 및 디코더를 통해, 결합된 잠재 표현에 대한 출력 텍스트를 획득하는 단계를 포함한다.In order to achieve the above object, a text style conversion method according to an aspect according to the technical spirit of the present disclosure includes: obtaining input text; obtaining, through an encoder, a latent representation for the obtained input text; acquiring a style embedding corresponding to a target style through the style embedding model; coupling the obtained style embeddings to the latent representation; and obtaining, via the decoder, output text for the combined latent representation.

실시 예에 따라, 상기 잠재 표현을 획득하는 단계는, 상기 입력 텍스트를 상기 인코더로 입력하는 단계; 및 상기 인코더의 신경망을 통해, 상기 입력 텍스트에 대응하는 상기 잠재 표현을 획득하는 단계를 포함할 수 있다.According to an embodiment, obtaining the latent representation comprises: inputting the input text into the encoder; and obtaining, through a neural network of the encoder, the latent representation corresponding to the input text.

실시 예에 따라, 상기 스타일 임베딩을 획득하는 단계는, 상기 타겟 스타일에 대응하는 스타일 정보를 상기 스타일 임베딩 모델로 입력하는 단계; 및 상기 스타일 임베딩 모델의 신경망을 통해, 상기 타겟 스타일에 대응하는 상기 스타일 임베딩을 획득하는 단계를 포함할 수 있다.According to an embodiment, the obtaining of the style embedding may include: inputting style information corresponding to the target style into the style embedding model; and obtaining the style embedding corresponding to the target style through a neural network of the style embedding model.

실시 예에 따라, 상기 출력 텍스트를 획득하는 단계는, 상기 결합된 잠재 표현을 상기 디코더로 입력하는 단계; 및 상기 디코더의 신경망을 통해, 상기 결합된 잠재 표현에 대응하는 상기 출력 텍스트를 획득하는 단계를 포함하고, 상기 출력 텍스트는 상기 입력 텍스트를 상기 타겟 스타일에 따라 변환하여 재구성한 텍스트일 수 있다.According to an embodiment, obtaining the output text comprises: inputting the combined latent representation into the decoder; and obtaining the output text corresponding to the combined latent expression through the neural network of the decoder, wherein the output text may be text reconstructed by transforming the input text according to the target style.

실시 예에 따라, 상기 잠재 표현 및 상기 스타일 임베딩은 벡터 형태를 갖고, 상기 결합하는 단계는, 상기 잠재 표현 및 상기 스타일 임베딩의 벡터 합을 통해 상기 결합된 잠재 표현을 획득하는 단계를 포함할 수 있다.According to an embodiment, the latent expression and the style embedding may have a vector form, and the combining may include obtaining the combined latent expression through a vector sum of the latent expression and the style embedding. .

실시 예에 따라, 상기 결합된 잠재 표현을 획득하는 단계는, 상기 스타일 임베딩에 스타일 강도를 적용하는 단계; 및 상기 스타일 강도가 적용된 상기 스타일 임베딩과 상기 잠재 표현의 벡터 합을 통해 상기 결합된 잠재 표현을 획득하는 단계를 포함하고, 상기 출력 텍스트를 획득하는 단계는, 상기 스타일 강도에 따라 변화하는 출력 텍스트를 획득하는 단계를 포함할 수 있다.According to an embodiment, obtaining the combined latent expression includes: applying a style strength to the style embedding; and obtaining the combined latent expression through a vector sum of the style embedding to which the style intensity is applied and the latent expression, wherein the step of obtaining the output text includes an output text that changes according to the style intensity. It may include the step of obtaining.

본 개시의 기술적 사상에 의한 일 양태에 따른 텍스트 스타일 변환 시스템은, 입력 텍스트로부터 잠재 표현 벡터를 제공하는 신경망을 포함하는 인코더; 타겟 스타일에 대응하는 스타일 임베딩 벡터를 제공하는 신경망을 포함하는 스타일 임베딩 모델; 및 상기 잠재 표현 벡터와 상기 스타일 임베딩 벡터의 결합에 의해 제공되는 결합된 잠재 표현 벡터를 이용하여 출력 텍스트를 제공하는 신경망을 포함하는 디코더를 구현하도록 구성되는 적어도 하나의 컴퓨팅 장치를 포함한다.A text style conversion system according to an aspect according to the technical spirit of the present disclosure includes: an encoder including a neural network providing a latent expression vector from input text; a style embedding model comprising a neural network providing a style embedding vector corresponding to a target style; and at least one computing device configured to implement a decoder comprising a neural network that provides output text using a combined latent representation vector provided by a combination of the latent representation vector and the style embedding vector.

본 개시의 기술적 사상에 의한 일 양태에 따른 텍스트 스타일 변환 시스템은 입력 텍스트로부터 스타일 변환된 출력 텍스트를 재구성하는 인코더와 디코더, 및 스타일 변환을 위한 스타일 임베딩 벡터를 제공하는 스타일 임베딩 모델을 포함한다. 상기 텍스트 스타일 변환 시스템의 학습 방법은, 상기 출력 텍스트의 재구성 결과에 기초하여 상기 인코더와 상기 디코더의 학습을 제어하는 단계; 및 스타일의 분류 결과에 기초하여 상기 스타일 임베딩 모델의 학습을 제어하는 단계를 포함한다.A text style conversion system according to an aspect according to the technical spirit of the present disclosure includes an encoder and a decoder for reconstructing style-converted output text from input text, and a style embedding model that provides a style embedding vector for style conversion. The learning method of the text style conversion system may include: controlling learning of the encoder and the decoder based on a reconstruction result of the output text; and controlling learning of the style embedding model based on the classification result of the style.

실시 예에 따라, 상기 인코더와 상기 디코더의 학습을 제어하는 단계는, 상기 출력 텍스트의 재구성 결과에 기초한 재구성 손실 함수에 따라, 상기 인코더에 포함된 신경망 및 상기 디코더에 포함된 신경망을 업데이트하는 단계를 포함할 수 있다.According to an embodiment, the controlling of the learning of the encoder and the decoder may include updating the neural network included in the encoder and the neural network included in the decoder according to a reconstruction loss function based on the reconstruction result of the output text. may include

실시 예에 따라, 상기 인코더와 상기 디코더의 학습을 제어하는 단계는, 상기 인코더의 신경망이, 상기 입력 텍스트를 이용하여 잠재 표현 벡터를 제공하는 단계; 상기 스타일 임베딩 모델의 신경망이, 상기 입력 텍스트의 스타일 정보를 이용하여 스타일 임베딩 벡터를 제공하는 단계; 상기 잠재 표현 벡터와 상기 스타일 임베딩 벡터의 결합을 통해 결합된 잠재 표현 벡터를 획득하는 단계; 및 상기 디코더의 신경망이, 상기 결합된 잠재 표현 벡터를 이용하여 상기 출력 텍스트를 재구성하는 단계를 더 포함할 수 있다.According to an embodiment, the controlling of the learning of the encoder and the decoder may include: providing, by a neural network of the encoder, a latent expression vector using the input text; providing, by the neural network of the style embedding model, a style embedding vector using style information of the input text; obtaining a combined latent expression vector through the combination of the latent expression vector and the style embedding vector; and reconstructing, by the neural network of the decoder, the output text using the combined latent expression vector.

실시 예에 따라, 상기 스타일 임베딩 모델의 학습을 제어하는 단계는, 상기 인코더의 신경망이, 상기 입력 텍스트를 이용하여 잠재 표현 벡터를 제공하는 단계; 설정된 스타일의 수에 대응하는 복수의 스타일 임베딩들 각각에 대해, 상기 잠재 표현과의 유사도를 산출하는 단계; 산출된 유사도들에 기초하여 상기 입력 텍스트의 스타일을 분류하는 단계; 및 분류 결과에 기초한 분류 손실 함수에 따라 상기 스타일 임베딩 모델의 신경망의 학습을 제어하는 단계를 포함할 수 있다.According to an embodiment, the controlling of the learning of the style embedding model may include: providing, by the neural network of the encoder, a latent expression vector using the input text; calculating a degree of similarity with the latent expression for each of a plurality of style embeddings corresponding to the set number of styles; classifying the style of the input text based on the calculated similarities; and controlling learning of the neural network of the style embedding model according to a classification loss function based on the classification result.

본 개시의 기술적 사상에 따르면, 스타일 표현을 위한 스타일 임베딩 모델을 문장 재구성을 위한 인코더 및 디코더와 분리함으로써, 인코더 및 디코더의 신경망 구조가 보다 간단해지고, 텍스트의 재구성 능력이 향상될 수 있다.According to the technical idea of the present disclosure, by separating the style embedding model for style expression from the encoder and the decoder for sentence reconstruction, the neural network structure of the encoder and the decoder can be simplified, and the text reconstruction ability can be improved.

또한, 상기 스타일 임베딩 모델이 분리됨에 따라, 스타일 변환 시 스타일 강도를 설정 및 조절하여 스타일 변환 정도를 변화시킬 수 있다. 이에 따라, 종래의 방식에 비해 보다 연속적인 스타일 변환이 가능하므로, 텍스트 스타일 변환 시스템의 활용도가 향상될 수 있다.In addition, as the style embedding model is separated, the degree of style conversion may be changed by setting and adjusting style strength during style conversion. Accordingly, since more continuous style conversion is possible compared to the conventional method, the utility of the text style conversion system can be improved.

본 개시의 기술적 사상에 따른 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.Effects according to the technical spirit of the present disclosure are not limited to the above-mentioned effects, and other effects not mentioned may be clearly understood by those of ordinary skill in the art to which the present invention belongs from the description below. There will be.

본 개시에서 인용되는 도면을 보다 충분히 이해하기 위하여 각 도면의 간단한 설명이 제공된다.
도 1은 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 시스템의 개략적인 블록도이다.
도 2는 본 개시의 예시적 실시 예에 따른 문장 재구성 모듈의 인코더 및 디코더의 학습 동작을 설명하기 위한 도면이다.
도 3은 본 개시의 예시적 실시 예에 따른 스타일 임베딩 모듈의 스타일 임베딩 모델 및 스타일 분류기의 학습 동작을 설명하기 위한 플로우차트이다.
도 4는 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 방법을 설명하기 위한 플로우차트이다.
도 5는 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 시스템의 텍스트 스타일 변환 동작을 설명하기 위한 도면이다.
도 6은 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 방법에 따라 입력 텍스트의 스타일이 변환된 출력 텍스트의 예들을 나타낸다.
도 7은 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 방법에 따른 출력 텍스트와, 종래의 방법에 따른 출력 텍스트를 비교한 예이다.
도 8은 도 1의 텍스트 스타일 변환 시스템을 구성하는 디바이스의 제어 구성을 나타내는 개략적인 블록도이다.
In order to more fully understand the drawings cited in this disclosure, a brief description of each drawing is provided.
1 is a schematic block diagram of a text style conversion system according to an exemplary embodiment of the present disclosure.
2 is a diagram for explaining learning operations of an encoder and a decoder of a sentence reconstruction module according to an exemplary embodiment of the present disclosure.
3 is a flowchart illustrating a learning operation of a style embedding model of a style embedding module and a style classifier according to an exemplary embodiment of the present disclosure.
4 is a flowchart illustrating a text style conversion method according to an exemplary embodiment of the present disclosure.
5 is a diagram for explaining a text style conversion operation of a text style conversion system according to an exemplary embodiment of the present disclosure.
6 illustrates examples of output text in which the style of input text is converted according to a text style conversion method according to an exemplary embodiment of the present disclosure.
7 is an example of comparing output text according to a text style conversion method according to an exemplary embodiment of the present disclosure with output text according to a conventional method.
8 is a schematic block diagram illustrating a control configuration of a device constituting the text style conversion system of FIG. 1 .

본 개시의 기술적 사상에 따른 예시적인 실시 예들은 당해 기술 분야에서 통상의 지식을 가진 자에게 본 개시의 기술적 사상을 더욱 완전하게 설명하기 위하여 제공되는 것으로, 아래의 실시 예들은 여러 가지 다른 형태로 변형될 수 있으며, 본 개시의 기술적 사상의 범위가 아래의 실시 예들로 한정되는 것은 아니다. 오히려, 이들 실시 예들은 본 개시를 더욱 충실하고 완전하게 하며 당업자에게 본 발명의 기술적 사상을 완전하게 전달하기 위하여 제공되는 것이다.Exemplary embodiments according to the technical spirit of the present disclosure are provided to more fully explain the technical spirit of the present disclosure to those of ordinary skill in the art, and the following embodiments are modified in various other forms may be, and the scope of the technical spirit of the present disclosure is not limited to the following embodiments. Rather, these embodiments are provided to more fully and complete the present disclosure, and to fully convey the technical spirit of the present invention to those skilled in the art.

본 개시에서 제1, 제2 등의 용어가 다양한 부재, 영역, 층들, 부위 및/또는 구성 요소들을 설명하기 위하여 사용되지만, 이들 부재, 부품, 영역, 층들, 부위 및/또는 구성 요소들은 이들 용어에 의해 한정되어서는 안 됨은 자명하다. 이들 용어는 특정 순서나 상하, 또는 우열을 의미하지 않으며, 하나의 부재, 영역, 부위, 또는 구성 요소를 다른 부재, 영역, 부위 또는 구성 요소와 구별하기 위하여만 사용된다. 따라서, 이하 상술할 제1 부재, 영역, 부위 또는 구성 요소는 본 개시의 기술적 사상의 가르침으로부터 벗어나지 않고서도 제2 부재, 영역, 부위 또는 구성 요소를 지칭할 수 있다. 예를 들면, 본 개시의 권리 범위로부터 이탈되지 않은 채 제1 구성 요소는 제2 구성 요소로 명명될 수 있고, 유사하게 제2 구성 요소도 제1 구성 요소로 명명될 수 있다.Although the terms first, second, etc. are used in this disclosure to describe various members, regions, layers, regions, and/or components, these members, parts, regions, layers, regions, and/or components refer to these terms It is self-evident that it should not be limited by These terms do not imply a specific order, upper and lower, or superiority, and are used only to distinguish one member, region, region, or component from another member, region, region, or component. Accordingly, a first member, region, region, or component to be described below may refer to a second member, region, region, or component without departing from the teachings of the present disclosure. For example, without departing from the scope of the present disclosure, a first component may be referred to as a second component, and similarly, the second component may also be referred to as a first component.

달리 정의되지 않는 한, 여기에 사용되는 모든 용어들은 기술 용어와 과학 용어를 포함하여 본 개시의 개념이 속하는 기술 분야에서 통상의 지식을 가진 자가 공통적으로 이해하고 있는 바와 동일한 의미를 지닌다. 또한, 통상적으로 사용되는, 사전에 정의된 바와 같은 용어들은 관련되는 기술의 맥락에서 이들이 의미하는 바와 일관되는 의미를 갖는 것으로 해석되어야 하며, 여기에 명시적으로 정의하지 않는 한 과도하게 형식적인 의미로 해석되어서는 아니 될 것이다.Unless defined otherwise, all terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the concepts of this disclosure belong, including technical and scientific terms. In addition, commonly used terms as defined in the dictionary should be construed as having a meaning consistent with their meaning in the context of the relevant technology, and unless explicitly defined herein, in an overly formal sense. shall not be interpreted.

어떤 실시 예가 달리 구현 가능한 경우에 특정한 공정 순서는 설명되는 순서와 다르게 수행될 수도 있다. 예를 들면, 연속하여 설명되는 두 공정이 실질적으로 동시에 수행될 수도 있고, 설명되는 순서와 반대의 순서로 수행될 수도 있다.In cases where certain embodiments may be implemented differently, a specific process sequence may be performed differently from the described sequence. For example, two processes described in succession may be performed substantially simultaneously, or may be performed in an order opposite to the described order.

첨부한 도면에 있어서, 예를 들면, 제조 기술 및/또는 공차에 따라, 도시된 형상의 변형들이 예상될 수 있다. 따라서, 본 개시의 기술적 사상에 의한 실시 예들은 본 개시에 도시된 영역의 특정 형상에 제한된 것으로 해석되어서는 아니 되며, 예를 들면, 제조 과정에서 초래되는 형상의 변화를 포함하여야 한다. 도면 상의 동일한 구성요소에 대해서는 동일한 참조부호를 사용하고, 이들에 대한 중복된 설명은 생략한다.In the accompanying drawings, variations of the illustrated shapes can be expected, for example depending on manufacturing technology and/or tolerances. Therefore, the embodiments according to the technical spirit of the present disclosure should not be construed as being limited to the specific shape of the region shown in the present disclosure, but should include, for example, a change in shape resulting from a manufacturing process. The same reference numerals are used for the same components in the drawings, and duplicate descriptions thereof are omitted.

여기에서 사용된 '및/또는' 용어는 언급된 부재들의 각각 및 하나 이상의 모든 조합을 포함한다.As used herein, the term 'and/or' includes each and every combination of one or more of the recited elements.

이하에서는 첨부한 도면들을 참조하여 본 개시의 기술적 사상에 의한 실시 예들에 대해 상세히 설명한다.Hereinafter, embodiments according to the technical spirit of the present disclosure will be described in detail with reference to the accompanying drawings.

도 1은 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 시스템의 개략적인 블록도이다.1 is a schematic block diagram of a text style conversion system according to an exemplary embodiment of the present disclosure.

텍스트 스타일 변환(text style transfer)은, 입력된 텍스트의 내용은 보존하면서 새로운 스타일 또는 원하는 스타일을 반영하여 새로운 출력 텍스트를 제공하는 작업을 의미한다. 일례로, 텍스트 스타일 변환은 특정 스타일(예컨대, 긍정)이 포함된 입력 텍스트가 주어진 경우, 다른 스타일(예컨대, 부정)을 얻기 위해 상기 입력 텍스트를 변경하는 작업을 포함할 수 있다.Text style transfer refers to an operation of providing new output text by reflecting a new style or a desired style while preserving the content of input text. As an example, text style transformation may include, given input text that includes a particular style (eg, positive), changing the input text to obtain a different style (eg, negative).

최근 머신러닝, 딥러닝 등의 인공지능 기술이 발전함에 따라, 인공지능 기반의 학습을 통해 텍스트 스타일 변환을 위한 모델 또는 시스템을 구현하기 위한 다양한 연구들이 진행되고 있다.With the recent development of artificial intelligence technologies such as machine learning and deep learning, various studies are being conducted to implement a model or system for text style conversion through artificial intelligence-based learning.

이에 기초하여 도 1을 참조하면, 텍스트 스타일 변환 시스템(10)은 상술한 텍스트 스타일 변환 동작을 수행하는 시스템으로 구현될 수 있다. 이러한 텍스트 스타일 변환 시스템(10)은 하나 또는 둘 이상의 컴퓨팅 디바이스를 포함할 수 있다. 텍스트 스타일 변환 시스템(10)이 둘 이상의 컴퓨팅 디바이스로 구현되는 경우, 도 1에 도시된 구성들은 상기 둘 이상의 컴퓨팅 디바이스에 분할되어 구현되고, 상기 둘 이상의 컴퓨팅 디바이스는 네트워크를 통해 연결될 수 있다. Based on this, referring to FIG. 1 , the text style conversion system 10 may be implemented as a system that performs the above-described text style conversion operation. Such text style conversion system 10 may include one or more computing devices. When the text style conversion system 10 is implemented with two or more computing devices, the configurations shown in FIG. 1 are divided into the two or more computing devices, and the two or more computing devices may be connected through a network.

본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 시스템(10)은 문장 재구성 모듈(11) 및 스타일 임베딩 모듈(13)을 포함할 수 있다.The text style conversion system 10 according to an exemplary embodiment of the present disclosure may include a sentence reconstruction module 11 and a style embedding module 13 .

문장 재구성 모듈(11)은 입력 텍스트의 재구성(복원)을 통해 출력 텍스트를 제공하는 동작, 및 이를 위한 학습 동작을 수행하는 모듈일 수 있다. 예컨대, 문장 재구성 모듈(11)은 인코더(111) 및 디코더(113)를 포함할 수 있다. The sentence reconstruction module 11 may be a module that performs an operation of providing an output text through reconstruction (reconstruction) of the input text, and a learning operation for this. For example, the sentence reconstruction module 11 may include an encoder 111 and a decoder 113 .

인코더(111)는 입력 텍스트를 처리하여, 상기 입력 텍스트에 대응하는 잠재 표현(latent representation)을 제공할 수 있다. 상기 잠재 표현은 입력 텍스트의 압축된 표현으로서, 일례로 벡터 형태를 가질 수 있다. 따라서, 상기 잠재 표현은 잠재 표현 벡터로도 지칭될 수 있다.The encoder 111 may process the input text to provide a latent representation corresponding to the input text. The latent representation is a compressed representation of the input text, and may have, for example, a vector form. Accordingly, the latent expression may also be referred to as a latent expression vector.

디코더(113)는 인코더(111)로부터 제공된 상기 잠재 표현, 또는 상기 잠재 표현에 스타일 임베딩 모듈(13)로부터 제공되는 스타일 임베딩(style embedding)이 결합된 잠재 표현을 이용하여 출력 텍스트를 제공할 수 있다. 이를 정리하면, 디코더(113)는 입력 텍스트를 상기 스타일 임베딩에 대응하는 스타일로 변환하여 재구성한 출력 텍스트를 제공할 수 있다.The decoder 113 may provide the output text using the latent representation provided from the encoder 111 or a latent representation in which style embedding provided from the style embedding module 13 is combined with the latent representation. . In summary, the decoder 113 may provide the reconstructed output text by converting the input text into a style corresponding to the style embedding.

인코더(111)와 디코더(113) 각각은 신경망(neural network)을 포함하는 하드웨어, 소프트웨어, 또는 이들의 조합으로 구현될 수 있다. 실시 예에 따라, 인코더(111)와 디코더(113)는, 텍스트에 포함된 동일한 단어에 대한 다양한 의미를 포착하기 위해, Transformer 기반의 시퀀스 대 시퀀스 모델로 구현될 수 있다. 예컨대, 동일한 단어가 감성적 텍스트에서 미묘하게 다른 의미를 가질 수 있고, 인코더(111)와 디코더(113)는 Transformer 기반 모델에서 관계 정보를 사용함으로써 상술한 미묘한 차이를 포착할 수 있다. 상기 Transformer 기반의 시퀀스 대 시퀀스 모델에 대해서는 "Google's multilingual neural machine translation system: Enablindg zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339-351 (Johnson et al. 2017)", "Attention is all you need. In advances in neural information processing systems, pages 5998-6008 (Vaswani et al. 2017)" 등에 의해 공지된 바, 이에 대한 상세한 설명은 생략하기로 한다.Each of the encoder 111 and the decoder 113 may be implemented as hardware including a neural network, software, or a combination thereof. According to an embodiment, the encoder 111 and the decoder 113 may be implemented as a Transformer-based sequence-to-sequence model in order to capture various meanings of the same word included in text. For example, the same word may have subtly different meanings in emotional text, and the encoder 111 and decoder 113 may capture the aforementioned nuances by using relational information in a Transformer-based model. For the Transformer-based sequence-to-sequence model, see "Google's multilingual neural machine translation system: Enablindg zero-shot translation. Transactions of the Association for Computational Linguistics, 5:339-351 (Johnson et al. 2017)", "Attention is all You need.

인코더(111)의 신경망은 상기 입력 텍스트로부터 상기 잠재 표현을 제공하도록 학습되고, 디코더(113)의 신경망은 상기 잠재 표현으로부터 출력 텍스트를 제공하도록 학습될 수 있다. 실시 예에 따라, 인코더(111) 및 디코더(113)는 오토인코더(autoencoder)로 구현되어, 입력 텍스트와 동일한 출력 텍스트를 제공하도록 학습될 수 있다.The neural network of the encoder 111 may be trained to provide the latent representation from the input text, and the neural network of the decoder 113 may be trained to provide the output text from the latent representation. According to an embodiment, the encoder 111 and the decoder 113 may be implemented as autoencoders, and may be trained to provide the same output text as the input text.

종래의 경우, 텍스트 스타일 변환을 위한 하나의 모듈(모델)에서 문장의 재구성을 위한 학습 및 스타일 변환을 위한 학습이 모두 수행되도록 구현되었다. 이에 따라 모델의 구조가 복잡해지고, 스타일의 변환 시 이산적으로만 변환이 가능하다는 단점이 존재하였다.In the conventional case, it was implemented so that both learning for sentence reconstruction and learning for style transformation were performed in one module (model) for text style transformation. Accordingly, the structure of the model became complicated, and there were disadvantages that only discrete conversion was possible when the style was changed.

반면 본 개시의 실시 예에 따른 문장 재구성 모듈(11)에 포함된 인코더(111)와 디코더(113)는, 문장(텍스트)의 재구성 손실에 의해서만 학습(훈련)될 수 있으므로, 종래에 비해 구조가 단순화될 수 있다. 또한 문장의 재구성을 위한 학습이 집중적으로 수행될 수 있고, 그 결과 문장의 복원 능력이 종래에 비해 향상될 수 있다. On the other hand, since the encoder 111 and the decoder 113 included in the sentence reconstruction module 11 according to an embodiment of the present disclosure can be learned (trained) only by the reconstruction loss of the sentence (text), the structure is different than in the prior art. can be simplified. In addition, learning for the reconstruction of the sentence may be intensively performed, and as a result, the ability to restore the sentence may be improved compared to the related art.

인코더(111) 및 디코더(113)의 학습 동작과 관련된 상세한 내용은 추후 도 2를 통해 설명하기로 한다.Details related to the learning operation of the encoder 111 and the decoder 113 will be described later with reference to FIG. 2 .

한편, 스타일 임베딩 모듈(13)은 입력 스타일에 기초한 스타일 임베딩(style embedding)을 제공할 수 있다. 이러한 스타일 임베딩 모듈(13)은 스타일 임베딩 모델(131), 유사도 산출기(133), 및 스타일 분류기(style classifier; 135)를 포함할 수 있다.Meanwhile, the style embedding module 13 may provide style embedding based on the input style. The style embedding module 13 may include a style embedding model 131 , a similarity calculator 133 , and a style classifier 135 .

스타일 임베딩 모델(131)은 입력 스타일을 처리하여, 상기 입력 스타일에 대응하는 스타일 임베딩을 제공할 수 있다. 상기 스타일 임베딩은 벡터 형태로 제공될 수 있다. 이 경우, 상기 스타일 임베딩은 스타일 임베딩 벡터로도 지칭될 수 있다. 상기 입력 스타일은 변환하고자 하는 스타일(타겟 스타일)을 나타내는 스타일 정보(또는 스타일 레이블(label))에 대응할 수 있으나, 이에 한정되는 것은 아니다. 예컨대, 상기 입력 스타일은 긍정, 부정 등과 같이 문장의 전반적인 태도나 분위기 등을 나타낼 수 있다.The style embedding model 131 may process the input style to provide a style embedding corresponding to the input style. The style embedding may be provided in a vector form. In this case, the style embedding may also be referred to as a style embedding vector. The input style may correspond to style information (or style label) indicating a style (target style) to be converted, but is not limited thereto. For example, the input style may represent an overall attitude or atmosphere of a sentence, such as positive or negative.

전술한 바와 같이, 상기 스타일 임베딩은 인코더(111)로부터 제공되는 잠재 표현에 결합될 수 있다. 디코더(113)는 스타일 임베딩이 결합된 잠재 표현을 이용하여 출력 텍스트를 제공함으로써, 스타일 임베딩에 따라 스타일이 변환되는 텍스트를 재구성할 수 있다.As mentioned above, the style embeddings may be combined with the latent representation provided from the encoder 111 . The decoder 113 may reconstruct the text whose style is converted according to the style embedding by providing the output text using the latent expression combined with the style embedding.

또한, 본 개시의 실시 예에 따르면, 스타일 임베딩의 결합 시 스타일 강도가 설정될 수 있고, 이에 따라 스타일의 변환 정도가 달라질 수 있다. 예컨대 스타일 강도가 클수록 문장의 스타일 변환 정도가 강해질 수 있고, 스타일 강도 값의 부호에 따라 문장의 스타일이 유사 스타일로 변환되거나 반대 스타일로 변환될 수도 있다. 이에 대해서는 추후 도 5 내지 도 7을 참조하여 보다 상세히 설명하기로 한다.Also, according to an embodiment of the present disclosure, style strength may be set when style embeddings are combined, and accordingly, a degree of style transformation may vary. For example, as the style intensity increases, the degree of style conversion of the sentence may be stronger, and the style of the sentence may be converted into a similar style or the opposite style according to the sign of the style intensity value. This will be described in more detail later with reference to FIGS. 5 to 7 .

실시 예에 따라, 스타일 임베딩 모델(131)은 신경망(neural network)을 포함하는 하드웨어, 소프트웨어, 또는 이들의 조합으로 구현될 수 있다. 유사도 산출기(133) 및 스타일 분류기(135)는 스타일 임베딩 모델(131)의 학습을 위한 구성에 해당할 수 있다.According to an embodiment, the style embedding model 131 may be implemented as hardware including a neural network, software, or a combination thereof. The similarity calculator 133 and the style classifier 135 may correspond to a configuration for learning the style embedding model 131 .

스타일 임베딩 모듈(13)에 포함된 구성들을 이용한 학습 동작에 대해서는 추후 도 3을 통해 설명하기로 한다.A learning operation using the components included in the style embedding module 13 will be described later with reference to FIG. 3 .

도 2는 본 개시의 예시적 실시 예에 따른 문장 재구성 모듈의 인코더 및 디코더의 학습 동작을 설명하기 위한 도면이다.2 is a diagram for explaining learning operations of an encoder and a decoder of a sentence reconstruction module according to an exemplary embodiment of the present disclosure.

도 2 내지 도 3의 실시 예에 따른 학습 동작은 학습 디바이스에 의해 수행될 수 있다. 상기 학습 디바이스는 도 1의 텍스트 스타일 변환 시스템(10)을 구성하는 적어도 하나의 컴퓨팅 디바이스를 포함하거나, 별도의 학습용 컴퓨팅 디바이스를 포함할 수 있다.The learning operation according to the embodiment of FIGS. 2 to 3 may be performed by a learning device. The learning device may include at least one computing device constituting the text style conversion system 10 of FIG. 1 or a separate computing device for learning.

도 2를 참조하면, 입력 텍스트(x)가 인코더(111)로 입력되면, 인코더(111)는 입력 텍스트(x)에 기초한 잠재 표현(또는 잠재 표현 벡터; z)를 제공(출력)할 수 있다. 한편, 스타일 임베딩 모델(131)로는 입력 텍스트(x)의 스타일에 해당하는 입력 스타일(s)이 입력될 수 있다. 스타일 임베딩 모델(131)은 상기 입력 스타일(s)에 기초하여, 스타일 임베딩(또는 스타일 임베딩 벡터; se)을 제공할 수 있다. Referring to FIG. 2 , when input text x is input to the encoder 111 , the encoder 111 may provide (output) a latent representation (or latent representation vector; z) based on the input text x. . Meanwhile, an input style (s) corresponding to the style of the input text (x) may be input to the style embedding model 131 . The style embedding model 131 may provide a style embedding (or a style embedding vector; se) based on the input style (s).

인코더(111)로부터 제공되는 잠재 표현(z)과, 스타일 임베딩 모델(131)로부터 제공되는 스타일 임베딩(se)은 콤바이너(combiner; 112)에 의해 서로 결합될 수 있다. 예컨대, 결합된 잠재 표현(z*)은 잠재 표현(z)과 스타일 임베딩(se)의 벡터 합에 해당할 수 있으나, 이에 한정되는 것은 아니다. 결합된 잠재 표현(z*)은 디코더(113)로 입력될 수 있다. 디코더(113)는 상기 결합된 잠재 표현(z*)에 기초하여 출력 텍스트(x')를 제공할 수 있다.The latent expression z provided from the encoder 111 and the style embedding se provided from the style embedding model 131 may be combined with each other by a combiner 112 . For example, the combined latent expression (z*) may correspond to a vector sum of the latent expression (z) and the style embedding (se), but is not limited thereto. The combined latent representation z* may be input to the decoder 113 . The decoder 113 may provide an output text (x') based on the combined latent representation (z*).

실시 예에 따라, 인코더(111) 및 디코더(113)는 오토인코더로 구현됨으로써, 출력 텍스트(x')가 입력 텍스트(x)와 동일해지도록 학습될 수 있다. 인코더(111) 및 디코더(113)는 재구성 손실(reconstruction loss)이 최소화되도록 학습(훈련)될 수 있다. 실시 예에 따라, 학습 시 신뢰도 및 성능의 향상을 위해 라벨 스무딩 정규화(label smoothing regularization) 기법이 사용될 수 있다. 상기 재구성 손실(Lrec)은 아래의 수학식 1에 개시된 재구성 손실 함수에 따라 산출될 수 있다.According to an embodiment, the encoder 111 and the decoder 113 are implemented as autoencoders, so that the output text (x') may be learned to be the same as the input text (x). The encoder 111 and the decoder 113 may be trained (trained) such that a reconstruction loss is minimized. According to an embodiment, a label smoothing regularization technique may be used to improve reliability and performance during training. The reconstruction loss (L rec ) may be calculated according to the reconstruction loss function disclosed in Equation 1 below.

[수학식 1][Equation 1]

Figure pat00001
Figure pat00001

여기서, v는 어휘의 크기를 나타내고, ε는 스무딩 파라미터(smoothing parameter)를 나타낸다. p와

Figure pat00002
는 각각 어휘에 대한 예측 확률 분포와 실제 확률 분포를 나타낼 수 있다. Eθe 는 인코더를 나타내고, Dθd는 디코더를 나타낸다.Here, v represents the size of the vocabulary, and ε represents a smoothing parameter. with p
Figure pat00002
may represent the predicted probability distribution and the actual probability distribution for each vocabulary. E θe denotes an encoder, and D θd denotes a decoder.

인코더(111) 및 디코더(113) 각각은 재구성 손실(Lrec)에 기초하여, 상기 재구성 손실(Lrec)이 최소화되도록 신경망의 출력층 및 은닉층의 가중치를 갱신함으로써 학습 동작을 수행할 수 있다. 이 때 가중치를 갱신하는 동작은 역전파 알고리즘(back-propagation algorithm)에 따라 출력 텍스트의 생성 동작이 이루어지는 방향과는 반대의 방향으로 수행될 수 있다(예컨대, 디코더(113)의 신경망의 출력층, 은닉층, 인코더(111)의 신경망의 출력층, 및 은닉층의 순서).Each of the encoder 111 and the decoder 113 may perform a learning operation by updating the weights of the output layer and the hidden layer of the neural network based on the reconstruction loss L rec , so that the reconstruction loss L rec is minimized. In this case, the operation of updating the weight may be performed in a direction opposite to the direction in which the operation of generating the output text is performed according to the back-propagation algorithm (eg, the output layer and the hidden layer of the neural network of the decoder 113 ). , the output layer of the neural network of the encoder 111, and the order of the hidden layer).

한편, 이러한 재구성 손실(Lrec)은 인코더(111) 및 디코더(113)의 학습에만 영향을 미칠 뿐, 스타일 임베딩 모델(131)에는 영향을 미치지 않을 수 있다. 또한, 인코더(111) 및 디코더(113)는 재구성 손실(Lrec)에 의해서만 학습되므로, 문장의 재구성(복원)을 위한 집중적인 학습이 가능할 수 있다.On the other hand, this reconstruction loss (L rec ) only affects the learning of the encoder 111 and the decoder 113 , and may not affect the style embedding model 131 . In addition, since the encoder 111 and the decoder 113 are learned only by the reconstruction loss (L rec ), intensive learning for the reconstruction (reconstruction) of the sentence may be possible.

도 3은 본 개시의 예시적 실시 예에 따른 스타일 임베딩 모듈의 스타일 임베딩 모델 및 스타일 분류기의 학습 동작을 설명하기 위한 플로우차트이다.3 is a flowchart illustrating a learning operation of a style embedding model of a style embedding module and a style classifier according to an exemplary embodiment of the present disclosure.

도 3을 참조하면, 입력 텍스트(x)의 스타일을 나타내는 입력 스타일(s)이 스타일 임베딩 모델(131)로 입력될 수 있다.Referring to FIG. 3 , an input style (s) indicating the style of the input text (x) may be input to the style embedding model 131 .

스타일 임베딩 모델(131)은 복수의 스타일 임베딩들(S1, S2, ??, Sk; k는 스타일의 수(종류))을 포함하는 스타일 임베딩 세트(S)를 출력할 수 있다. 스타일 임베딩 세트(S)에 포함된 복수의 스타일 임베딩들 각각은 대응하는 스타일을 갖는 다양한 텍스트에 적용 가능한 일종의 공통 표현(common representation)에 해당할 수 있다. 이 경우, 복수의 스타일 임베딩들 중 어느 하나는, 입력 스타일(s)에 대응하는 스타일 임베딩에 해당할 수 있다. 예를 들어, 스타일의 종류가 '긍정' 및 '부정'의 두 가지인 경우, 스타일 임베딩 세트(S)는 '긍정'에 대응하는 제1 스타일 임베딩(S1)과, '부정'에 대응하는 제2 스타일 임베딩(S2)을 포함할 수 있다. 입력 스타일(s)이 '긍정'에 해당할 경우, 복수의 스타일 임베딩들 중 제1 스타일 임베딩(S1)이 입력 스타일(s)에 대응하는 스타일 임베딩일 수 있다.The style embedding model 131 may output a style embedding set S including a plurality of style embeddings (S 1 , S 2 , ??, S k ; k is the number (type) of styles). Each of the plurality of style embeddings included in the style embedding set S may correspond to a kind of common representation applicable to various texts having a corresponding style. In this case, any one of the plurality of style embeddings may correspond to a style embedding corresponding to the input style (s). For example, when the type of style is 'positive' and 'negative', the style embedding set S is a first style embedding S 1 corresponding to 'positive' and a first style embedding corresponding to 'negative'. The second style embedding (S 2 ) may be included. When the input style (s) corresponds to 'positive', the first style embedding (S 1 ) among the plurality of style embeddings may be a style embedding corresponding to the input style (s).

한편, 인코더(111)로는 입력 텍스트(x)가 입력될 수 있다. 인코더(111)는 상기 입력 텍스트(x)에 기초한 잠재 표현(z)를 제공(출력)할 수 있다. 입력 텍스트(x)에서 스타일 표현과 관련된 부분이 분리되지 않으므로, 잠재 표현(z)에는 입력 텍스트(x)의 스타일 특성이 반영될 수 있다.Meanwhile, the input text x may be input to the encoder 111 . The encoder 111 may provide (output) a latent representation z based on the input text x. Since the portion related to the style expression is not separated from the input text x, the style characteristic of the input text x may be reflected in the latent expression z.

유사도 산출기(133)는 스타일 임베딩 세트(S)에 포함된 스타일 임베딩들(S1, S2, ??, Sk) 각각과 잠재 표현(z) 사이의 유사도(SIM(z,S))를 산출할 수 있다. 예컨대, 유사도 산출기(133)는 스타일 임베딩과 잠재 표현의 내적(dot product)을 산출함으로써 상기 유사도를 산출할 수 있다.The similarity calculator 133 calculates the similarity (SIM(z,S)) between each of the style embeddings (S 1 , S 2 , ??, S k ) included in the style embedding set (S) and the latent expression (z). can be calculated. For example, the similarity calculator 133 may calculate the similarity by calculating a dot product of the style embedding and the latent expression.

스타일 분류기(135)는 산출된 유사도들을 비교하여, 가장 유사도가 높은 스타일 임베딩(s')을 입력 스타일(s)의 스타일 임베딩으로서 분류할 수 있다. 예컨대, 전술한 예시에서 입력 텍스트(x)의 스타일이 '긍정'에 해당할 경우, 제1 스타일 임베딩(S1)과 잠재 표현(z)의 유사도(SIM(z,S1))는 제2 스타일 임베딩(S2)과 잠재 표현(z)의 유사도(SIM(z,S2))보다 높을 수 있다.The style classifier 135 may classify the style embedding (s') having the highest similarity as the style embedding of the input style (s) by comparing the calculated similarities. For example, in the above example, when the style of the input text (x) corresponds to 'positive', the similarity (SIM(z,S 1 )) between the first style embedding (S 1 ) and the latent expression (z) is the second It may be higher than the similarity (SIM(z,S 2 )) between the style embedding (S 2 ) and the latent expression (z).

스타일 분류기(135)는 상기 분류된 스타일 임베딩에 대한 분류 손실을 아래의 수학식 2에 따라 개시된 분류 손실 함수에 따라 산출할 수 있다.The style classifier 135 may calculate the classification loss for the classified style embedding according to the classification loss function disclosed according to Equation 2 below.

[수학식 2][Equation 2]

Figure pat00003
Figure pat00003

여기서 Cθc 는 스타일 분류기(135)를 나타내고, si는 입력 텍스트 x의 스타일을 나타내며, simz,Si 는 잠재 표현과 스타일 임베딩 간의 유사성을 나타낼 수 있다. where C θc denotes the style classifier 135, si denotes the style of the input text x, and sim z ,Si denotes the similarity between the latent expression and the style embedding.

스타일 임베딩 모델(131) 및 스타일 분류기(135) 각각은, 분류 손실(Lse)에 기초하여, 상기 분류된 스타일 임베딩에 대한 분류 손실이 최소화되도록 신경망을 업데이트(출력층 및 은닉층의 가중치를 갱신)함으로써 학습 동작을 수행할 수 있다. 이 때 가중치를 갱신하는 동작은 역전파 알고리즘(back-propagation algorithm)에 따라 스타일의 분류 동작이 이루어지는 방향과는 반대의 방향으로 수행될 수 있다. Each of the style embedding model 131 and the style classifier 135 updates the neural network (updating the weights of the output layer and the hidden layer) so that the classification loss for the classified style embedding is minimized based on the classification loss (L se ). A learning operation can be performed. In this case, the operation of updating the weight may be performed in a direction opposite to the direction in which the style classification operation is performed according to a back-propagation algorithm.

한편, 이러한 분류 손실(Lse)은 스타일 임베딩 모델(131) 및 스타일 분류기(135)의 학습에만 영향을 미칠 뿐, 문장 재구성 모듈(11)에 포함된 인코더(111) 및 디코더(113)에는 영향을 미치지 않을 수 있다. 또한, 스타일 임베딩 모델(131)은 상기 분류 손실(Lse)에 의해서만 학습되므로, 스타일 변환을 위한 집중적인 학습이 가능할 수 있다.On the other hand, this classification loss (L se ) only affects the learning of the style embedding model 131 and the style classifier 135 , but also affects the encoder 111 and the decoder 113 included in the sentence reconstruction module 11 . may not reach In addition, since the style embedding model 131 is learned only by the classification loss L se , intensive learning for style transformation may be possible.

도 1 내지 도 3의 실시 예에 따르면, 본 개시의 실시 예에 따른 텍스트 스타일 변환 시스템(10)은 문장 재구성 모듈(11)과 스타일 임베딩 모듈(13)을 분리하여, 문장의 재구성(복원)을 위한 학습 및 스타일 표현을 위한 학습이 서로 분리되어 수행될 수 있다. 이에 따라, 문장 재구성 모듈(11)의 인코더(111)와 디코더(113)의 구조가 단순화되고, 문장의 복원 능력이 향상될 수 있다.1 to 3 , the text style conversion system 10 according to an embodiment of the present disclosure separates the sentence reconstruction module 11 and the style embedding module 13 to reconstruct (restore) the sentence. Learning for style expression and learning for style expression may be performed separately from each other. Accordingly, the structures of the encoder 111 and the decoder 113 of the sentence reconstruction module 11 may be simplified, and the sentence reconstruction ability may be improved.

상술한 실시 예들에 따라 학습된 문장 재구성 모듈(11) 및 스타일 임베딩 모듈(13)을 이용한 텍스트 스타일 변환 동작에 대해, 이하 도 4 내지 도 7을 참조하여 설명하기로 한다.A text style conversion operation using the learned sentence reconstruction module 11 and the style embedding module 13 according to the above-described embodiments will be described below with reference to FIGS. 4 to 7 .

도 4는 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 방법을 설명하기 위한 플로우차트이다. 도 5는 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 시스템의 텍스트 스타일 변환 동작을 설명하기 위한 도면이다.4 is a flowchart illustrating a text style conversion method according to an exemplary embodiment of the present disclosure. 5 is a diagram for explaining a text style conversion operation of a text style conversion system according to an exemplary embodiment of the present disclosure.

도 4와 도 5를 참조하면, 텍스트 스타일 변환 방법은 입력 텍스트(x)를 획득하는 단계(S300), 및 인코더(111)를 통해 입력 텍스트에 대한 잠재 표현을 획득하는 단계를 포함할 수 있다(S310).4 and 5 , the text style conversion method may include obtaining an input text x ( S300 ), and obtaining a latent representation for the input text through the encoder 111 ( S310).

입력 텍스트(x)는 텍스트 스타일 변환 시스템(10)을 구성하는 적어도 하나의 컴퓨팅 장치 중 어느 하나로 입력될 수 있다. 예컨대 입력 텍스트(x)는 통신 인터페이스나 각종 공지된 입력 수단을 통해 입력될 수 있다.The input text x may be input to any one of at least one computing device constituting the text style conversion system 10 . For example, the input text x may be input through a communication interface or various known input means.

인코더(111)는 신경망을 통해, 입력 텍스트(x)에 대응하는 잠재 표현(또는 잠재 표현 벡터)을 제공할 수 있다.The encoder 111 may provide a latent representation (or latent representation vector) corresponding to the input text x through a neural network.

텍스트 스타일 변환 방법은 스타일 임베딩 모델(131)로부터 출력되는 스타일 임베딩을 상기 잠재 표현에 결합하는 단계(S320), 및 디코더(113)를 통해, 상기 결합된 잠재 표현에 대한 출력 텍스트를 획득하는 단계를 포함할 수 있다(S330).The text style conversion method includes the steps of combining the style embedding output from the style embedding model 131 to the latent expression (S320), and through the decoder 113, obtaining the output text for the combined latent expression. may be included (S330).

스타일 임베딩 모델(131)은 변환할 스타일의 정보(또는 레이블)을 포함하는 입력 스타일(s)을 획득할 수 있다. 입력 텍스트(x)와 마찬가지로, 입력 스타일(s)은 상기 적어도 하나의 컴퓨팅 중 어느 하나로 입력될 수 있다. 한편, 입력 스타일(s)은 변환하고자 하는 타겟 스타일의 스타일 정보(또는 스타일 레이블)에 해당할 수 있으나, 실시 예에 따라서는 입력 텍스트(x)의 스타일을 나타내는 스타일 정보일 수도 있다. 스타일 임베딩 모델(131)은 신경망을 통해, 입력 스타일(s)에 대응하는 스타일 임베딩(또는 스타일 임베딩 벡터)을 제공할 수 있다.The style embedding model 131 may acquire an input style (s) including information (or label) of a style to be converted. Like the input text (x), the input style (s) may be input into any of said at least one computing. Meanwhile, the input style (s) may correspond to style information (or style label) of the target style to be converted, but may also be style information indicating the style of the input text (x) according to an embodiment. The style embedding model 131 may provide a style embedding (or a style embedding vector) corresponding to the input style (s) through a neural network.

텍스트 스타일 변환 시스템(10)은 상기 잠재 표현과 상기 스타일 임베딩을 결합함으로써, 결합된 잠재 표현을 획득할 수 있다. 상술한 바와 같이 텍스트 스타일 변환 시스템(10)은 상기 잠재 표현과 상기 스타일 임베딩의 벡터 합을 산출하는 콤바이너(112)를 포함할 수 있으나, 이에 한정되는 것은 아니다.The text style conversion system 10 may obtain a combined latent expression by combining the latent expression and the style embedding. As described above, the text style conversion system 10 may include a combiner 112 for calculating a vector sum of the latent expression and the style embedding, but is not limited thereto.

디코더(113)는 신경망을 통해, 상기 결합된 잠재 표현에 대응하는 출력 텍스트(y)를 제공함으로써, 입력 텍스트(x)의 스타일이 변환된 텍스트를 재구성할 수 있다.The decoder 113 may reconstruct the text in which the style of the input text x is converted by providing the output text y corresponding to the combined latent expression through the neural network.

실시 예에 따라, 텍스트 스타일 변환 시스템(10)은 상기 스타일 임베딩에 스타일 강도를 적용하고, 스타일 강도가 적용된 스타일 임베딩과 상기 잠재 표현을 결합할 수도 있다. 상술한 바와 같이, 스타일 강도의 값에 따라 스타일 변환의 정도가 달라질 수 있는 바, 스타일 강도의 적용에 따라 보다 다양한 출력 텍스트가 제공될 수 있다. 스타일 강도(w)는 아래의 수학식 3에 기초하여 적용될 수 있다.According to an embodiment, the text style conversion system 10 may apply a style strength to the style embedding, and may combine the style embedding to which the style strength is applied and the latent expression. As described above, the degree of style conversion may vary according to the value of the style strength, and thus more diverse output texts may be provided according to the application of the style strength. The style strength w may be applied based on Equation 3 below.

[수학식 3][Equation 3]

Figure pat00004
Figure pat00004

여기서, z*는 결합된 잠재 표현을 의미하고, z는 잠재 표현을 의미하며, se는 스타일 임베딩을 의미할 수 있다.Here, z* may mean a combined latent expression, z means a latent expression, and se may mean style embedding.

상기 수학식 3에 기초하면, 스타일 강도의 부호에 따라 출력 텍스트(y)의 스타일이 변경될 수도 있다. 예컨대 입력 스타일(s)이 입력 텍스트(x)의 스타일과 동일하고, 스타일 강도가 음수의 값을 갖는 경우, 출력 텍스트(y)는 입력 텍스트(x)와 반대의 스타일을 갖는 문장으로 재구성될 수 있을 것이다.Based on Equation 3, the style of the output text y may be changed according to the sign of the style strength. For example, if the input style (s) is the same as the style of the input text (x) and the style strength has a negative value, the output text (y) can be reconstructed into a sentence having a style opposite to that of the input text (x). There will be.

종래의 텍스트 스타일 변환 방법에 따르면 스타일 강도의 적용이 불가능하므로, 출력 텍스트의 스타일은 설정된 스타일의 종류에 따라 이산적으로 변환된다. 그러나, 본 개시에 따르면 스타일 강도의 조절에 따라 동일한 스타일에 대해서도 다양한 형태의 출력 텍스트가 제공될 수 있으므로, 출력 텍스트의 스타일이 보다 연속적으로 변환될 수 있다.Since it is impossible to apply style strength according to the conventional text style conversion method, the style of the output text is discretely converted according to the set style type. However, according to the present disclosure, various types of output text may be provided even for the same style according to the adjustment of style strength, so that the style of the output text may be more continuously converted.

이하 도 6 내지 도 7을 참조하여, 본 개시의 실시 예에 따른 텍스트 스타일 변환의 예들을 설명하기로 한다.Hereinafter, examples of text style conversion according to an embodiment of the present disclosure will be described with reference to FIGS. 6 to 7 .

도 6은 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 방법에 따라 입력 텍스트의 스타일이 변환된 출력 텍스트의 예들을 나타낸다.6 illustrates examples of output text in which the style of input text is converted according to a text style conversion method according to an exemplary embodiment of the present disclosure.

텍스트 스타일 변환 시스템(10)은 부정적(negative) 스타일을 갖는 입력 텍스트를 긍정적(positive) 스타일의 출력 텍스트로 변환할 수 있다. 예컨대, "so, no treatment and no medication to help me deal with my condition."과 같은 입력 텍스트에는 부정적 스타일을 나타내는 'no' 부분이 존재할 수 있다. 텍스트 스타일 변환 시스템(10)은 입력 텍스트 중 부정적 스타일과 관련된 부분(단어)을 긍정적 스타일을 나타내는 단어('best', 'great' 등)로 변경함으로써, 입력 텍스트를 긍정적 스타일의 출력 텍스트로 변환할 수 있다.The text style conversion system 10 may convert input text having a negative style into output text having a positive style. For example, an input text such as "so, no treatment and no medication to help me deal with my condition." may include a 'no' part indicating a negative style. The text style conversion system 10 converts the input text into positive style output text by changing the negative style-related part (word) of the input text to the positive style word ('best', 'great', etc.). can

이 경우, 스타일 임베딩 모듈(13)로 입력되는 입력 스타일은 '긍정'에 해당하는 스타일 정보(또는 스타일 레이블)일 수 있다. 또는, 입력 스타일은 상기 입력 텍스트의 스타일에 대응하는 '부정'에 해당하고, 입력 텍스트의 잠재 표현과 스타일 임베딩의 결합 시 스타일 강도(w)가 음수의 값을 가질 수 있다.In this case, the input style input to the style embedding module 13 may be style information (or style label) corresponding to 'positive'. Alternatively, the input style may correspond to 'negative' corresponding to the style of the input text, and the style strength w may have a negative value when the latent expression of the input text and style embedding are combined.

또는, 텍스트 스타일 변환 시스템(10)은 긍정적 스타일을 갖는 입력 텍스트를 부정적 스타일의 출력 텍스트로 변환할 수 있다. 예컨대, "he is very thorough and genuinely cares for his customers."와 같은 입력 텍스트에는 긍정적 스타일을 나타내는 'thorough' 및 'genuinely'부분이 존재할 수 있다. 텍스트 스타일 변환 시스템(10)은 입력 텍스트 중 긍정적 스타일과 관련된 부분(단어)을 부정적 스타일을 나타내는 단어('never', 'lazy', 'not' 등)로 변경함으로써, 입력 텍스트를 부정적 스타일의 출력 텍스트로 변환할 수 있다.Alternatively, the text style conversion system 10 may convert input text having a positive style into output text having a negative style. For example, 'thorough' and 'genuinely' parts representing positive styles may exist in input text such as "he is very thorough and genuinely cares for his customers." The text style conversion system 10 changes the part (word) related to the positive style of the input text to the word ('never', 'lazy', 'not', etc.) indicating the negative style, thereby outputting the input text in a negative style. can be converted to text.

이 경우, 스타일 임베딩 모듈(13)로 입력되는 입력 스타일은 '부정'에 해당하는 스타일 정보(또는 스타일 레이블)일 수 있다. 또는, 입력 스타일은 상기 입력 텍스트의 스타일에 대응하는 '부정'에 해당하고, 입력 텍스트의 잠재 표현과 스타일 임베딩의 결합 시 스타일 강도(w)가 음수의 값을 가질 수 있다.In this case, the input style input to the style embedding module 13 may be style information (or style label) corresponding to 'negative'. Alternatively, the input style may correspond to 'negative' corresponding to the style of the input text, and the style strength w may have a negative value when the latent expression of the input text and style embedding are combined.

또한, 텍스트 스타일 변환 시스템(10)은 스타일 강도(w)에 따라 서로 다른 출력 텍스트를 제공할 수도 있다. 텍스트 스타일 변환 시스템(10)은 스타일 강도(w)의 값이 클수록 스타일 변환 정도가 증가한 출력 텍스트를 제공할 수 있다. 도 6에 도시된 예들 각각에서, 스타일 강도(w)가 8에서 10으로 증가할수록 출력 텍스트의 변환 정도가 전반적으로 증가함을 확인할 수 있다.Also, the text style conversion system 10 may provide different output texts according to the style strength w. The text style conversion system 10 may provide the output text in which the degree of style conversion is increased as the value of the style strength w is increased. In each of the examples shown in FIG. 6 , it can be seen that as the style strength w increases from 8 to 10, the conversion degree of the output text generally increases.

본 개시의 실시 예에 따른 텍스트 스타일 변환 시스템(10)은 문장의 재구성을 위한 문장 재구성 모듈(11)과, 스타일 표현을 위한 스타일 임베딩 모듈(13)이 분리되어 구현됨으로써, 스타일 변환 시 스타일 강도를 적용함으로써 보다 다양한 형태의 출력 텍스트를 획득할 수 있다. In the text style conversion system 10 according to an embodiment of the present disclosure, the sentence reconstruction module 11 for reconstructing a sentence and the style embedding module 13 for style expression are separately implemented, thereby increasing style strength during style conversion. By applying it, more various types of output text can be obtained.

도 7은 본 개시의 예시적 실시 예에 따른 텍스트 스타일 변환 방법에 따른 출력 텍스트와, 종래의 방법에 따른 출력 텍스트를 비교한 예이다.7 is an example of comparing output text according to a text style conversion method according to an exemplary embodiment of the present disclosure with output text according to a conventional method.

종래의 텍스트 스타일 변환 방법의 경우 하나의 모델에서 문장 재구성 및 스타일 임베딩의 학습이 모두 이루어질 수 있다. 이에 따라 모델의 복잡도가 증가하게 되고, 스타일 변환 시 이산적 스타일 변환만이 가능해지는 문제가 존재한다. 도 7에 도시된 바와 같이, 종래의 방법은 동일한 스타일로의 변환 시에는 입력 텍스트와 동일한 출력 텍스트만을 제공하게 된다.In the case of the conventional text style conversion method, both learning of sentence reconstruction and style embedding can be performed in one model. Accordingly, the complexity of the model increases, and there is a problem that only discrete style conversion is possible during style conversion. As shown in FIG. 7 , in the conventional method, only the output text identical to the input text is provided when converting to the same style.

반면, 본 개시의 실시 예에 따른 텍스트 스타일 변환 방법의 경우, 문장 재구성 모듈(11)과 스타일 임베딩 모듈(13)이 별도로 구현되므로, 스타일 변환 시 보다 다양한 표현을 활용한 스타일 변환이 가능할 수 있다. 도 7에 도시된 바와 같이, 본 개시의 실시 예에 따른 텍스트 스타일 변환 방법의 경우, 입력 텍스트를 동일한 스타일로 변환하더라도 입력 텍스트와는 다른 표현이 포함된 출력 텍스트가 제공될 수 있다.On the other hand, in the case of the text style conversion method according to an embodiment of the present disclosure, since the sentence reconstruction module 11 and the style embedding module 13 are separately implemented, style conversion using more diverse expressions may be possible during style conversion. 7 , in the case of the text style conversion method according to an embodiment of the present disclosure, output text including an expression different from the input text may be provided even if the input text is converted into the same style.

하기의 표 1은, 종래의 텍스트 스타일 변환 방법과 본 개시의 실시 예에 따른 텍스트 스타일 변환 방법에 대한 평가 결과를 나타낸다.Table 1 below shows evaluation results of the conventional text style conversion method and the text style conversion method according to an embodiment of the present disclosure.

[표 1][Table 1]

Figure pat00005
Figure pat00005

표 1에 기재된 'Accuracy' 항목은 입력 텍스트와 출력 텍스트의 동일성을 나타내는 항목으로서, 값이 낮을수록 스타일 변환 정도가 높음을 나타낸다. 즉, 본 개시에 따른 텍스트 스타일 변환 방법은 종래의 방법에 비해 텍스트의 스타일 변환이 효과적으로 이루어짐을 알 수 있다. 한편, 본 개시에 따르면 스타일 강도의 조절이 가능하고, 스타일 강도가 낮아질수록 스타일 변환 정도가 감소하므로 'Accuracy'항목의 값은 높아질 수 있다.The 'Accuracy' item in Table 1 is an item indicating the sameness of input text and output text, and a lower value indicates a higher degree of style conversion. That is, it can be seen that the text style conversion method according to the present disclosure effectively converts the text style compared to the conventional method. Meanwhile, according to the present disclosure, it is possible to adjust the style intensity, and as the style intensity decreases, the degree of style conversion decreases, so the value of the 'Accuracy' item may increase.

또한, 'Self-BLEU(bilingual evaluation understudy)' 항목은 텍스트 중 스타일과 관련되지 않은 부분의 동일성에 대한 항목으로서, 값이 높을수록 입력 텍스트 중 스타일과 관련되지 않은 부분이 잘 유지된 출력 텍스트가 재구성됨을 의미한다. 즉, 본 개시에 따른 텍스트 스타일 변환 방법은 종래의 방법에 비해 입력 텍스트 중 스타일과 관련되지 않은 부분을 잘 유지하고 있음을 알 수 있다.In addition, the 'Self-BLEU (bilingual evaluation understudy)' item is an item for the identity of the non-styled part of the text. The higher the value, the better the output text with the non-styled part of the input text is reconstructed. means to be That is, it can be seen that the text style conversion method according to the present disclosure maintains a portion of the input text that is not related to the style better than the conventional method.

도 8은 도 1의 텍스트 스타일 변환 시스템을 구성하는 디바이스의 제어 구성을 나타내는 개략적인 블록도이다.8 is a schematic block diagram illustrating a control configuration of a device constituting the text style conversion system of FIG. 1 .

도 8을 참조하면, 본 개시의 실시 예에 따른 디바이스(800)는 도 1에서 상술한 텍스트 스타일 변환 시스템(10)을 구성하는 적어도 하나의 컴퓨팅 장치 중 어느 하나에 대응할 수 있다.Referring to FIG. 8 , a device 800 according to an embodiment of the present disclosure may correspond to any one of at least one computing device constituting the text style conversion system 10 described above in FIG. 1 .

이러한 디바이스(800)는 프로세서(810) 및 메모리(830)를 포함할 수 있다. 다만, 디바이스(800)의 구성 요소가 전술한 예에 한정되는 것은 아니다. 예를 들어, 디바이스(800)는 전술한 구성 요소들보다 더 많은 구성 요소를 포함하거나 더 적은 구성 요소를 포함할 수 있다. 또한, 프로세서(810)는 적어도 하나일 수 있으며, 메모리(830) 또한 적어도 하나일 수 있다. 또한, 프로세서(810) 및 메모리(830)가 하나의 칩으로 결합된 형태일 수도 있다.The device 800 may include a processor 810 and a memory 830 . However, the components of the device 800 are not limited to the above-described example. For example, the device 800 may include more or fewer components than the aforementioned components. In addition, the processor 810 may be at least one, and the memory 830 may also be at least one. Also, the processor 810 and the memory 830 may be combined into one chip.

본 개시의 일 실시 예에 따르면, 프로세서(810)는 입력 텍스트 및 상기 입력 텍스트의 스타일 정보를 이용하여 문장 재구성 모듈(11)의 인코더(111) 및 디코더(113)의 학습을 수행할 수 있다. 또한, 프로세서(810)는 입력 텍스트 및 스타일 정보를 이용하여 스타일 임베딩 모듈(13)의 학습을 수행할 수 있다.According to an embodiment of the present disclosure, the processor 810 may perform learning of the encoder 111 and the decoder 113 of the sentence reconstruction module 11 by using the input text and style information of the input text. Also, the processor 810 may perform learning of the style embedding module 13 using the input text and style information.

실시 예에 따라, 프로세서(810)는 프로세서(810)는 학습된 문장 재구성 모듈(11) 및 스타일 임베딩 모듈(13)을 이용하여, 입력 텍스트의 스타일을 타겟 스타일로 변환한 출력 텍스트를 획득하거나, 입력 텍스트의 스타일을 스타일 강도에 따라 다양하게 변환한 출력 텍스트를 획득할 수 있다.According to an embodiment, the processor 810 obtains the output text obtained by converting the style of the input text into the target style by using the learned sentence reconstruction module 11 and the style embedding module 13, It is possible to obtain the output text in which the style of the input text is variously converted according to the style strength.

이러한 프로세서(810)는 CPU, AP(application processor), 집적 회로, 마이크로컴퓨터, ASIC(application specific integrated circuit), FPGA(field programmable gate array), 및/또는 NPU(neural processing unit) 등의 하드웨어를 포함할 수 있다.The processor 810 includes hardware such as a CPU, an application processor (AP), an integrated circuit, a microcomputer, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), and/or a neural processing unit (NPU). can do.

본 개시의 일 실시 예에 따르면, 메모리(830)는 디바이스(800)의 동작에 필요한 프로그램 및 데이터를 저장할 수 있다.According to an embodiment of the present disclosure, the memory 830 may store programs and data necessary for the operation of the device 800 .

또한, 메모리(830)는 프로세서(810)를 통해 생성되거나 획득된 데이터 중 적어도 하나를 저장할 수 있다. 예를 들어, 메모리(830)는 학습용 텍스트나 손실 함수 등을 저장할 수 있다.Also, the memory 830 may store at least one of data generated or acquired through the processor 810 . For example, the memory 830 may store text for training or a loss function.

메모리(830)는 롬(ROM), 램(RAM), 플래시 메모리, SSD, HDD 등의 저장 매체 또는 저장 매체들의 조합으로 구성될 수 있다.The memory 830 may be configured of a storage medium such as ROM, RAM, flash memory, SSD, HDD, or a combination of storage media.

상기한 실시 예들의 설명은 본 개시의 더욱 철저한 이해를 위하여 도면을 참조로 예를 든 것들에 불과하므로, 본 개시의 기술적 사상을 한정하는 의미로 해석되어서는 안될 것이다. Since the descriptions of the above embodiments are merely those given with reference to the drawings for a more thorough understanding of the present disclosure, they should not be construed as limiting the technical spirit of the present disclosure.

또한, 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자에게 있어 본 개시의 기본적 원리를 벗어나지 않는 범위 내에서 다양한 변화와 변경이 가능함은 명백하다 할 것이다.In addition, it will be apparent to those of ordinary skill in the art to which the present disclosure pertains that various changes and modifications can be made without departing from the basic principles of the present disclosure.

Claims (15)

입력 텍스트를 획득하는 단계;
인코더를 통해, 획득된 입력 텍스트에 대한 잠재 표현(latent representation)을 획득하는 단계;
스타일 임베딩 모델을 통해, 타겟 스타일에 대응하는 스타일 임베딩(style embedding)을 획득하는 단계;
획득된 스타일 임베딩을 상기 잠재 표현에 결합하는 단계; 및
디코더를 통해, 결합된 잠재 표현에 대한 출력 텍스트를 획득하는 단계를 포함하는,
텍스트 스타일 변환 방법.
obtaining input text;
obtaining, through an encoder, a latent representation of the obtained input text;
acquiring a style embedding corresponding to the target style through the style embedding model;
coupling the obtained style embeddings to the latent representation; and
obtaining, via a decoder, output text for the combined latent representation;
How to convert text styles.
제1항에 있어서,
상기 잠재 표현을 획득하는 단계는,
상기 입력 텍스트를 상기 인코더로 입력하는 단계; 및
상기 인코더의 신경망을 통해, 상기 입력 텍스트에 대응하는 상기 잠재 표현을 획득하는 단계를 포함하는,
텍스트 스타일 변환 방법.
According to claim 1,
The step of obtaining the latent expression comprises:
inputting the input text into the encoder; and
obtaining, via a neural network of the encoder, the latent representation corresponding to the input text;
How to convert text styles.
제2항에 있어서,
상기 스타일 임베딩을 획득하는 단계는,
상기 타겟 스타일에 대응하는 스타일 정보를 상기 스타일 임베딩 모델로 입력하는 단계; 및
상기 스타일 임베딩 모델의 신경망을 통해, 상기 타겟 스타일에 대응하는 상기 스타일 임베딩을 획득하는 단계를 포함하는,
텍스트 스타일 변환 방법.
3. The method of claim 2,
The step of obtaining the style embedding comprises:
inputting style information corresponding to the target style into the style embedding model; and
Acquiring the style embedding corresponding to the target style through a neural network of the style embedding model,
How to convert text styles.
제3항에 있어서,
상기 출력 텍스트를 획득하는 단계는,
상기 결합된 잠재 표현을 상기 디코더로 입력하는 단계; 및
상기 디코더의 신경망을 통해, 상기 결합된 잠재 표현에 대응하는 상기 출력 텍스트를 획득하는 단계를 포함하고,
상기 출력 텍스트는 상기 입력 텍스트를 상기 타겟 스타일에 따라 변환하여 재구성한 텍스트인
텍스트 스타일 변환 방법.
4. The method of claim 3,
Obtaining the output text comprises:
inputting the combined latent representation to the decoder; and
obtaining, via the neural network of the decoder, the output text corresponding to the combined latent representation,
The output text is text reconstructed by converting the input text according to the target style.
How to convert text styles.
제1항에 있어서,
상기 잠재 표현 및 상기 스타일 임베딩은 벡터 형태를 갖고,
상기 결합하는 단계는,
상기 잠재 표현 및 상기 스타일 임베딩의 벡터 합을 통해 상기 결합된 잠재 표현을 획득하는 단계를 포함하는,
텍스트 스타일 변환 방법.
According to claim 1,
the latent representation and the style embedding have a vector form,
The combining step is
obtaining the combined latent representation through a vector sum of the latent representation and the style embedding,
How to convert text styles.
제5항에 있어서,
상기 결합된 잠재 표현을 획득하는 단계는,
상기 스타일 임베딩에 스타일 강도를 적용하는 단계; 및
상기 스타일 강도가 적용된 상기 스타일 임베딩과 상기 잠재 표현의 벡터 합을 통해 상기 결합된 잠재 표현을 획득하는 단계를 포함하고,
상기 출력 텍스트를 획득하는 단계는,
상기 스타일 강도에 따라 변화하는 출력 텍스트를 획득하는,
텍스트 스타일 변환 방법.
6. The method of claim 5,
The step of obtaining the combined latent expression comprises:
applying a style strength to the style embedding; and
obtaining the combined latent expression through a vector sum of the style embedding to which the style strength is applied and the latent expression;
Obtaining the output text comprises:
to obtain an output text that changes according to the style strength,
How to convert text styles.
입력 텍스트로부터 잠재 표현 벡터를 제공하는 신경망을 포함하는 인코더;
타겟 스타일에 대응하는 스타일 임베딩 벡터를 제공하는 신경망을 포함하는 스타일 임베딩 모델; 및
상기 잠재 표현 벡터와 상기 스타일 임베딩 벡터의 결합에 의해 제공되는 결합된 잠재 표현 벡터를 이용하여 출력 텍스트를 제공하는 신경망을 포함하는 디코더를 구현하도록 구성되는 적어도 하나의 컴퓨팅 장치를 포함하는,
텍스트 스타일 변환 시스템.
an encoder comprising a neural network providing a latent representation vector from the input text;
a style embedding model comprising a neural network providing a style embedding vector corresponding to a target style; and
at least one computing device configured to implement a decoder comprising a neural network that provides output text using a combined latent representation vector provided by the combination of the latent representation vector and the style embedding vector;
Text style conversion system.
제7항에 있어서,
상기 결합된 잠재 표현 벡터는,
상기 잠재 표현 벡터와 상기 스타일 임베딩 벡터의 벡터 합에 의해 제공되는,
텍스트 스타일 변환 시스템.
8. The method of claim 7,
The combined latent expression vector is,
provided by the vector sum of the latent expression vector and the style embedding vector,
Text style conversion system.
제8항에 있어서,
상기 적어도 하나의 컴퓨팅 장치 중 어느 하나는,
상기 스타일 임베딩 벡터에 스타일 강도를 적용하고,
상기 스타일 강도가 적용된 상기 스타일 임베딩 벡터와 상기 잠재 표현 벡터의 벡터 합을 통해 상기 결합된 잠재 표현을 제공하도록 구현되는,
텍스트 스타일 변환 시스템.
9. The method of claim 8,
Any one of the at least one computing device,
applying a style strength to the style embedding vector;
implemented to provide the combined latent representation through a vector sum of the style embedding vector to which the style strength is applied and the latent representation vector,
Text style conversion system.
제9항에 있어서,
상기 디코더는,
상기 스타일 강도에 따라 변화하는 출력 텍스트를 제공하는,
텍스트 스타일 변환 시스템.
10. The method of claim 9,
The decoder is
providing output text that changes according to the style strength;
Text style conversion system.
제9항에 있어서,
상기 적어도 하나의 컴퓨팅 장치 중 어느 하나는,
서로 다른 스타일 강도가 적용된 복수의 스타일 임베딩 벡터들을 제공하고,
상기 디코더는, 상기 복수의 스타일 임베딩 벡터들과 상기 잠재 표현에 기초하여 복수의 출력 텍스트를 제공하고,
상기 복수의 출력 텍스트 중 적어도 일부는 서로 다른,
텍스트 스타일 변환 시스템.
10. The method of claim 9,
Any one of the at least one computing device,
Provides a plurality of style embedding vectors to which different style strengths are applied,
the decoder provides a plurality of output texts based on the plurality of style embedding vectors and the latent representation;
at least some of the plurality of output texts are different from each other;
Text style conversion system.
입력 텍스트로부터 스타일 변환된 출력 텍스트를 재구성하는 인코더와 디코더, 및 스타일 변환을 위한 스타일 임베딩 벡터를 제공하는 스타일 임베딩 모델을 포함하는 텍스트 스타일 변환 시스템의 학습 방법에 있어서,
상기 출력 텍스트의 재구성 결과에 기초하여 상기 인코더와 상기 디코더의 학습을 제어하는 단계; 및
스타일의 분류 결과에 기초하여 상기 스타일 임베딩 모델의 학습을 제어하는 단계를 포함하는,
텍스트 스타일 변환 시스템의 학습 방법.
A learning method of a text style transformation system comprising an encoder and a decoder for reconstructing style-converted output text from input text, and a style embedding model for providing a style embedding vector for style transformation,
controlling learning of the encoder and the decoder based on the reconstruction result of the output text; and
Including the step of controlling the learning of the style embedding model based on the classification result of the style,
How to learn text style conversion system.
제12항에 있어서,
상기 인코더와 상기 디코더의 학습을 제어하는 단계는,
상기 출력 텍스트의 재구성 결과에 기초한 재구성 손실 함수에 따라, 상기 인코더에 포함된 신경망 및 상기 디코더에 포함된 신경망을 업데이트하는 단계를 포함하는,
텍스트 스타일 변환 시스템의 학습 방법.
13. The method of claim 12,
Controlling the learning of the encoder and the decoder comprises:
Updating the neural network included in the encoder and the neural network included in the decoder according to a reconstruction loss function based on the reconstruction result of the output text,
How to learn text style conversion system.
제13항에 있어서,
상기 인코더와 상기 디코더의 학습을 제어하는 단계는,
상기 인코더의 신경망이, 상기 입력 텍스트를 이용하여 잠재 표현 벡터를 제공하는 단계;
상기 스타일 임베딩 모델의 신경망이, 상기 입력 텍스트의 스타일 정보를 이용하여 스타일 임베딩 벡터를 제공하는 단계;
상기 잠재 표현 벡터와 상기 스타일 임베딩 벡터의 결합을 통해 결합된 잠재 표현 벡터를 획득하는 단계; 및
상기 디코더의 신경망이, 상기 결합된 잠재 표현 벡터를 이용하여 상기 출력 텍스트를 재구성하는 단계를 더 포함하는,
텍스트 스타일 변환 시스템의 학습 방법.
14. The method of claim 13,
Controlling the learning of the encoder and the decoder comprises:
providing, by the neural network of the encoder, a latent expression vector using the input text;
providing, by the neural network of the style embedding model, a style embedding vector using style information of the input text;
obtaining a combined latent expression vector through the combination of the latent expression vector and the style embedding vector; and
Reconstructing, by the neural network of the decoder, the output text using the combined latent expression vector;
How to learn text style conversion system.
제12항에 있어서,
상기 스타일 임베딩 모델의 학습을 제어하는 단계는,
상기 인코더의 신경망이, 상기 입력 텍스트를 이용하여 잠재 표현 벡터를 제공하는 단계;
설정된 스타일의 수에 대응하는 복수의 스타일 임베딩들 각각에 대해, 상기 잠재 표현과의 유사도를 산출하는 단계;
산출된 유사도들에 기초하여 상기 입력 텍스트의 스타일을 분류하는 단계; 및
분류 결과에 기초한 분류 손실 함수에 따라 상기 스타일 임베딩 모델의 신경망의 학습을 제어하는 단계를 포함하는,
텍스트 스타일 변환 시스템의 학습 방법.
13. The method of claim 12,
The step of controlling the learning of the style embedding model,
providing, by the neural network of the encoder, a latent expression vector using the input text;
calculating a degree of similarity with the latent expression for each of a plurality of style embeddings corresponding to the set number of styles;
classifying the style of the input text based on the calculated similarities; and
Controlling the learning of the neural network of the style embedding model according to a classification loss function based on the classification result,
How to learn text style conversion system.
KR1020200126671A 2020-09-29 2020-09-29 Method and system for text style transfer, and learning method for implementing same KR102417036B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200126671A KR102417036B1 (en) 2020-09-29 2020-09-29 Method and system for text style transfer, and learning method for implementing same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200126671A KR102417036B1 (en) 2020-09-29 2020-09-29 Method and system for text style transfer, and learning method for implementing same

Publications (2)

Publication Number Publication Date
KR20220044011A true KR20220044011A (en) 2022-04-06
KR102417036B1 KR102417036B1 (en) 2022-07-06

Family

ID=81211704

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200126671A KR102417036B1 (en) 2020-09-29 2020-09-29 Method and system for text style transfer, and learning method for implementing same

Country Status (1)

Country Link
KR (1) KR102417036B1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115879469A (en) * 2022-12-30 2023-03-31 北京百度网讯科技有限公司 Text data processing method, model training method, device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20190096877A (en) * 2019-07-31 2019-08-20 엘지전자 주식회사 Artificial intelligence(ai)-based voice sampling apparatus and method for providing speech style in heterogeneous label
KR20190104269A (en) * 2019-07-25 2019-09-09 엘지전자 주식회사 Artificial intelligence(ai)-based voice sampling apparatus and method for providing speech style
KR20200049499A (en) * 2018-10-26 2020-05-08 삼성전자주식회사 Method and system for stochastic inference between multiple random variables via common representation
KR20200080400A (en) * 2018-12-18 2020-07-07 삼성전자주식회사 Method for providing sententce based on persona and electronic device for supporting the same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20200049499A (en) * 2018-10-26 2020-05-08 삼성전자주식회사 Method and system for stochastic inference between multiple random variables via common representation
KR20200080400A (en) * 2018-12-18 2020-07-07 삼성전자주식회사 Method for providing sententce based on persona and electronic device for supporting the same
KR20190104269A (en) * 2019-07-25 2019-09-09 엘지전자 주식회사 Artificial intelligence(ai)-based voice sampling apparatus and method for providing speech style
KR20190096877A (en) * 2019-07-31 2019-08-20 엘지전자 주식회사 Artificial intelligence(ai)-based voice sampling apparatus and method for providing speech style in heterogeneous label

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Joosung Lee, 'Stable Style Transformer: Delete and Generate Approach with Encoder-Decoder for Text Style Transfer', arXiv:2005.12086v1, 2020.05 *
Ruozi Huang et al., 'How Sequence-to-Sequence Models Perceive Language Styles?', arXiv:1908.05947v1, 2019.08.16 *
Vineet John et al., ‘Disentangled Representation Learning for Non-Parallel Text Style Transfer’, arXiv:1808.04339v2, 2018.09 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115879469A (en) * 2022-12-30 2023-03-31 北京百度网讯科技有限公司 Text data processing method, model training method, device and medium
CN115879469B (en) * 2022-12-30 2023-10-03 北京百度网讯科技有限公司 Text data processing method, model training method, device and medium

Also Published As

Publication number Publication date
KR102417036B1 (en) 2022-07-06

Similar Documents

Publication Publication Date Title
Khan et al. A survey of the recent architectures of deep convolutional neural networks
Gu et al. Projective dictionary pair learning for pattern classification
US11645835B2 (en) Hypercomplex deep learning methods, architectures, and apparatus for multimodal small, medium, and large-scale data representation, analysis, and applications
CN106547735B (en) Construction and use method of context-aware dynamic word or word vector based on deep learning
Zhang et al. Sparse codes auto-extractor for classification: A joint embedding and dictionary learning framework for representation
Boughida et al. A novel approach for facial expression recognition based on Gabor filters and genetic algorithm
Hnoohom et al. Thai fast food image classification using deep learning
Fei et al. Low rank representation with adaptive distance penalty for semi-supervised subspace classification
US20230325673A1 (en) Neural network training utilizing loss functions reflecting neighbor token dependencies
CN110222213B (en) Image classification method based on heterogeneous tensor decomposition
KR20190041790A (en) Apparatus and method for constructing neural network translation model
CN110059324A (en) Neural network machine interpretation method and device based on the supervision of interdependent information
CN113157919B (en) Sentence text aspect-level emotion classification method and sentence text aspect-level emotion classification system
Seyyedsalehi et al. Simultaneous learning of nonlinear manifolds based on the bottleneck neural network
Yan et al. Unsupervised facial expression recognition using domain adaptation based dictionary learning approach
Aich et al. Convolutional neural network-based model for web-based text classification.
KR102417036B1 (en) Method and system for text style transfer, and learning method for implementing same
Wang et al. Learning to hallucinate face in the dark
Li et al. Spatial-temporal dynamic hand gesture recognition via hybrid deep learning model
Fan et al. Accurate recognition and simulation of 3D visual image of aerobics movement
Wang et al. Distance correlation autoencoder
Wang et al. A new transfer learning boosting approach based on distribution measure with an application on facial expression recognition
Kumar et al. Offline handwritten character recognition using improved back-propagation algorithm
Liu et al. Face recognition based on manifold constrained joint sparse sensing with K-SVD
Sun et al. Unsupervised Orthogonal Facial Representation Extraction via image reconstruction with correlation minimization

Legal Events

Date Code Title Description
E701 Decision to grant or registration of patent right
GRNT Written decision to grant