KR102326473B1 - Text sensibility analysis apparatus and method threrof - Google Patents

Text sensibility analysis apparatus and method threrof Download PDF

Info

Publication number
KR102326473B1
KR102326473B1 KR1020190063386A KR20190063386A KR102326473B1 KR 102326473 B1 KR102326473 B1 KR 102326473B1 KR 1020190063386 A KR1020190063386 A KR 1020190063386A KR 20190063386 A KR20190063386 A KR 20190063386A KR 102326473 B1 KR102326473 B1 KR 102326473B1
Authority
KR
South Korea
Prior art keywords
text
word
embedding
sentiment analysis
value
Prior art date
Application number
KR1020190063386A
Other languages
Korean (ko)
Other versions
KR20200137290A (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 KR1020190063386A priority Critical patent/KR102326473B1/en
Publication of KR20200137290A publication Critical patent/KR20200137290A/en
Application granted granted Critical
Publication of KR102326473B1 publication Critical patent/KR102326473B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • G06F40/35Discourse or dialogue representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Machine Translation (AREA)

Abstract

텍스트에 대한 감성 분석을 수행하는 텍스트 감성 분석 장치에 관한 것으로서, 복수의 단어를 포함하는 적어도 하나 이상의 문장들로 구성되는 텍스트를 입력받고, 상기 적어도 하나 이상의 문장의 문맥에 기초하여 상기 단어에 대한 임베딩 값을 산출하는 임베딩 계층 및 상기 산출된 임베딩 값을 입력받고, 상기 텍스트에 대한 감성 정보를 출력하는 적어도 하나의 완전 연결 계층을 포함하는 감성 분석 모델을 구축하는 구축부, 및 상기 구축된 감성 분석 모델을 이용하여 실시간으로 입력되는 텍스트에 대한 감성 정보를 분석하는 분석부를 포함하되, 상기 임베딩 계층은 복수의 문장의 문맥에 기초하여 단어에 대한 임베딩 값을 산출하도록 사전 학습될 수 있다.A text sentiment analysis apparatus for performing sentiment analysis on text, receiving a text composed of at least one sentence including a plurality of words, and embedding the word based on the context of the at least one sentence A construction unit for constructing a sentiment analysis model including an embedding layer that calculates a value and at least one fully connected layer that receives the calculated embedding value and outputs sentiment information for the text, and the built sentiment analysis model and an analysis unit that analyzes sentiment information on text input in real time using

Description

텍스트 감성 분석 장치 및 방법{TEXT SENSIBILITY ANALYSIS APPARATUS AND METHOD THREROF}Text sentiment analysis apparatus and method {TEXT SENSIBILITY ANALYSIS APPARATUS AND METHOD THREROF}

본 발명은 텍스트 감성 분석 장치 및 방법에 관한 것이다.The present invention relates to a text sentiment analysis apparatus and method.

소셜 미디어의 발달과 온라인 상품 시장의 확산으로 인해 실시간 생성되는 텍스트의 양이 폭발적으로 증가해왔다.Due to the development of social media and the proliferation of online product markets, the amount of text generated in real time has exploded.

이처럼 끊임없이 생성되는 텍스트를 텍스트 스트림(text stream)이라 칭하며, 이러한 텍스트 스트림을 분석하여 대중의 의견을 파악하는 것은 효과적인 의사결정을 가능하게 한다.Such constantly generated text is called a text stream, and analyzing such text stream to understand public opinion enables effective decision-making.

한편, 텍스트 마이닝 기법 중 감성 분석은 대중의 반응을 실시간으로 모니터링할 수 있는 좋은 분석 방법이다. On the other hand, sentiment analysis among text mining techniques is a good analysis method that can monitor the reaction of the public in real time.

이때, 시시각각 다양한 주제를 갖는 텍스트 스트림에 대한 감성 분석은 모델의 구축과 개선이 실시간으로 이루어져야 의미가 있다. In this case, sentiment analysis for text streams having various topics from moment to moment is meaningful when model construction and improvement are performed in real time.

이를 위해서는 순차적으로 들어오는 데이터에 대한 즉각적인 학습을 실행하는 온라인 학습이 필요하다. 그러나, 텍스트 스트림을 저장한 후 저장한 데이터에 대해 반복 학습을 실행하는 배치 학습은 텍스트 스트림 분석에 적절하지 않은 방법이다.This requires online learning, which executes instant learning on sequentially incoming data. However, batch learning, which stores a text stream and then executes iterative learning on the stored data, is not a suitable method for text stream analysis.

또한, 온라인 학습은 스트림 형태의 데이터에 대하여 단 한번만의 조회를 수행하여 학습 모델을 얻어내는 학습 기법이다. 이것이 가능하기 위해서는 데이터로부터 좋은 특징을 추출하여 데이터에 대한 단일 조회만으로 데이터의 패턴을 파악할 수 있어야 한다. In addition, online learning is a learning technique that obtains a learning model by performing an inquiry on stream-type data only once. In order for this to be possible, it is necessary to extract good features from the data and identify patterns in the data with only a single inquiry into the data.

아울러, 학습 과정이 신속히 이루어져 스트림 데이터의 처리 지연을 피할 수 있어야 한다. 즉, 온라인 학습이 가능한 딥러닝 모델은 데이터로부터 좋은 특징을 추출함과 동시에 신속한 학습을 위한 간단한 구조를 가져야 한다.In addition, the learning process should be performed quickly to avoid delay in processing the stream data. In other words, a deep learning model capable of online learning should have a simple structure for rapid learning while extracting good features from data.

하지만, 딥러닝에서 특징 추출과 패턴 학습이 함께 이루어진다는 점을 고려할 때, 간단한 구조를 가지면서 좋은 특징을 추출하는 것은 동시에 만족하기 어렵다는 한계가 있었다.However, considering that feature extraction and pattern learning are performed together in deep learning, there is a limitation in that it is difficult to simultaneously extract good features with a simple structure.

따라서, 텍스트로부터 온라인 학습을 위한 좋은 특징을 추출하기 위해서는 문맥 기반 단어 임베딩이 요구되는데, 기존 스트림 환경에서 감성 분석을 위한 딥러닝 연구의 경우, 문맥에 의존하지 않는 단어 임베딩을 통한 배치 학습으로 딥러닝 모델을 구축한 후 이를 실시간으로 운용하는 방법에 초점을 맞추어 왔다.Therefore, context-based word embedding is required to extract good features for online learning from text. After building a model, the focus has been on how to operate it in real time.

그러나, 이 방식은 주제가 지속적으로 바뀌는 텍스트 스트림 환경에 적절하지 않으며, 또한 이는 배치 학습을 위해서 텍스트를 저장해 놓아야 한다는 단점을 가지고 있었다.However, this method is not suitable for a text stream environment in which the subject is constantly changing, and it also has a disadvantage in that the text needs to be stored for batch learning.

본 발명은 전술한 종래 기술의 문제점을 해결하기 위한 것으로서, 단어를 수치화하여 임베딩 값을 산출하는 임베딩 계층을 사전 학습시키되, 문맥에 기초하여 단어에 대한 임베딩 값을 산출하도록 임베딩 계층을 학습시킴으로써, 동일한 단어의 경우에도, 문맥에 따라 다른 임베딩 값을 산출하도록 하여, 텍스트 마이닝 기법의 감성 분석 정확도를 향상시킬 수 있는 텍스트 감성 분석 장치 및 방법을 제공하고자 한다.The present invention is to solve the problems of the prior art described above, by pre-learning an embedding layer that calculates an embedding value by digitizing a word, and by learning the embedding layer to calculate an embedding value for a word based on the context, the same An object of the present invention is to provide a text sentiment analysis apparatus and method capable of improving the sentiment analysis accuracy of a text mining technique by calculating different embedding values according to context even in the case of words.

다만, 본 실시예가 이루고자 하는 기술적 과제는 상기된 바와 같은 기술적 과제들로 한정되지 않으며, 또 다른 기술적 과제들이 존재할 수 있다.However, the technical problems to be achieved by the present embodiment are not limited to the technical problems described above, and other technical problems may exist.

상술한 기술적 과제를 달성하기 위한 기술적 수단으로서, 본 발명의 일 측면에 따른 텍스트에 대한 감성 분석을 수행하는 텍스트 감성 분석 장치는, 복수의 단어를 포함하는 적어도 하나 이상의 문장들로 구성되는 텍스트를 입력받고, 상기 적어도 하나 이상의 문장의 문맥에 기초하여 상기 단어에 대한 임베딩 값을 산출하는 임베딩 계층 및 상기 산출된 임베딩 값을 입력받고, 상기 텍스트에 대한 감성 정보를 출력하는 적어도 하나의 완전 연결 계층을 포함하는 감성 분석 모델을 구축하는 구축부; 및 상기 구축된 감성 분석 모델을 이용하여 실시간으로 입력되는 텍스트에 대한 감성 정보를 분석하는 분석부를 포함하되, 상기 임베딩 계층은 복수의 문장의 문맥에 기초하여 단어에 대한 임베딩 값을 산출하도록 사전 학습될 수 있다.As a technical means for achieving the above technical problem, the text sentiment analysis apparatus for performing sentiment analysis on text according to an aspect of the present invention inputs text composed of at least one sentence including a plurality of words. an embedding layer for calculating an embedding value for the word based on the context of the at least one sentence or more, and at least one fully connected layer for receiving the calculated embedding value and outputting sentiment information for the text a construction unit that builds a sentiment analysis model; and an analysis unit that analyzes sentiment information for text input in real time using the built sentiment analysis model, wherein the embedding layer is pre-learned to calculate an embedding value for a word based on the context of a plurality of sentences. can

또한, 본 발명의 일 측면에 따른 텍스트에 대한 감성 분석을 수행하는 텍스트 감성 분석 방법은, 감성 분석 모델을 구축하는 단계; 및 상기 구축된 감성 분석 모델을 이용하여 실시간으로 입력되는 텍스트에 대한 감성 정보를 분석하는 단계를 포함하되, 상기 감성 분석 모델을 구축하는 단계는, 복수의 단어를 포함하는 적어도 하나 이상의 문장들로 구성되는 텍스트를 입력받고, 상기 적어도 하나 이상의 문장의 문맥에 기초하여 상기 단어에 대한 임베딩 값을 산출하는 단계; 및 상기 산출된 임베딩 값을 입력받고, 상기 텍스트에 대한 감성 정보를 출력하는 단계를 포함하고, 상기 단어에 대한 임베딩 값의 산출은 복수의 문장의 문맥에 기초하여 단어에 대한 임베딩 값을 산출하도록 한 사전 학습에 기초할 수 있다.In addition, according to an aspect of the present invention, a text sentiment analysis method for performing sentiment analysis on text includes: building a sentiment analysis model; and analyzing the emotion information on the text input in real time by using the built emotion analysis model, wherein the step of constructing the emotion analysis model includes at least one sentence including a plurality of words receiving an inputted text and calculating an embedding value for the word based on the context of the at least one sentence; and receiving the calculated embedding value and outputting sentiment information for the text, wherein the calculation of the embedding value for the word is to calculate the embedding value for the word based on the context of a plurality of sentences It can be based on prior learning.

상술한 과제 해결 수단은 단지 예시적인 것으로서, 본 발명을 제한하려는 의도로 해석되지 않아야 한다. 상술한 예시적인 실시예 외에도, 도면 및 발명의 상세한 설명에 기재된 추가적인 실시예가 존재할 수 있다.The above-described problem solving means are merely exemplary, and should not be construed as limiting the present invention. In addition to the exemplary embodiments described above, there may be additional embodiments described in the drawings and detailed description.

전술한 본 발명의 과제 해결 수단 중 어느 하나에 의하면, 본 발명은 단어를 수치화하여 임베딩 값을 산출하는 임베딩 계층을 사전 학습시키되, 문맥에 기초하여 단어에 대한 임베딩 값을 산출하도록 임베딩 계층을 학습시킴으로써, 동일한 단어의 경우에도, 문맥에 따라 다른 임베딩 값을 산출하도록 하여, 텍스트 마이닝 기법의 감성 분석 정확도를 향상시킬 수 있는 텍스트 감성 분석 장치 및 방법을 제공할 수 있다.According to any one of the above-described problem solving means of the present invention, the present invention pre-learns an embedding layer for calculating an embedding value by digitizing a word, by learning the embedding layer to calculate an embedding value for a word based on the context. , it is possible to provide a text sentiment analysis apparatus and method capable of improving the sentiment analysis accuracy of the text mining technique by calculating different embedding values according to context even for the same word.

또한, 본 발명은 문맥에 기초하여 단어에 대한 임베딩 값을 산출하도록 사전 학습된 임베딩 계층을 이용하여, 텍스트에 대한 감성 분석을 수행하는 감성 분석 모델을 구축함으로써, 간단한 구조로 텍스트에 대한 감성 분석을 수행할 수 있도록 하는 텍스트 감성 분석 장치 및 방법을 제공할 수 있다.In addition, the present invention uses an embedding layer learned in advance to calculate an embedding value for a word based on context, and builds a sentiment analysis model that performs sentiment analysis on text, thereby performing sentiment analysis on text with a simple structure. It is possible to provide an apparatus and method for analyzing text sentiment that can be performed.

아울러, 본 발명은 텍스트별 감성 분석 결과를 학습하여, 입력되는 텍스트에 대해 보다 신속한 감성 분석이 가능하도록 하되, 사전 학습된 임베딩 계층의 경우, 텍스트별 감성 분석 결과 학습 과정에서 제외시킴으로써, 보다 신속하게 텍스트에 대한 감성 분석 학습이 가능하도록 하는 텍스트 감성 분석 장치 및 방법을 제공할 수 있다.In addition, the present invention learns the emotion analysis result for each text to enable faster emotion analysis on the input text, but in the case of the pre-learned embedding layer, by excluding the emotion analysis result for each text from the learning process, more quickly It is possible to provide a text sentiment analysis apparatus and method for enabling sentiment analysis learning on text.

도 1은 본 발명의 일 실시예에 따른 텍스트 감성 분석 장치의 구성을 나타낸 도면이다.
도 2는 본 발명의 일 실시예에 따른 감성 분석 모델의 구성을 나타낸 도면이다.
도 3은 본 발명의 일 실시예에 따른 은닉 계층의 구성을 나타낸 도면이다.
도 4는 본 발명의 일 실시예에 따른 은닉층의 구성을 나타낸 도면이다.
도 5는 본 발명의 일 실시예에 따른 가중치 할당부의 가중치 할당 방법을 나타낸 도면이다.
도 6은 본 발명의 일 실시예에 따른 텍스트 감성 분석 방법의 흐름을 나타낸 도면이다.
도 7은 본 발명의 일 실시예에 따른 감성 분석 모델 구축 방법의 흐름을 나타낸 도면이다.
1 is a diagram showing the configuration of a text sentiment analysis apparatus according to an embodiment of the present invention.
2 is a diagram showing the configuration of a sentiment analysis model according to an embodiment of the present invention.
3 is a diagram illustrating the configuration of a hidden layer according to an embodiment of the present invention.
4 is a diagram showing the configuration of a hidden layer according to an embodiment of the present invention.
5 is a diagram illustrating a weight allocation method of a weight allocator according to an embodiment of the present invention.
6 is a diagram illustrating a flow of a text sentiment analysis method according to an embodiment of the present invention.
7 is a diagram illustrating a flow of a method for constructing a sentiment analysis model according to an embodiment of the present invention.

아래에서는 첨부한 도면을 참조하여 본 발명이 속하는 기술 분야에서 통상의 지식을 가진 자가 용이하게 실시할 수 있도록 본 발명의 실시예를 상세히 설명한다. 그러나 본 발명은 여러 가지 상이한 형태로 구현될 수 있으며 여기에서 설명하는 실시예에 한정되지 않는다. 그리고 도면에서 본 발명을 명확하게 설명하기 위해서 설명과 관계없는 부분은 생략하였으며, 명세서 전체를 통하여 유사한 부분에 대해서는 유사한 도면 부호를 붙였다.DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings so that those of ordinary skill in the art can easily implement them. However, the present invention may be embodied in several different forms and is not limited to the embodiments described herein. And in order to clearly explain the present invention in the drawings, parts irrelevant to the description are omitted, and similar reference numerals are attached to similar parts throughout the specification.

명세서 전체에서, 어떤 부분이 다른 부분과 "연결"되어 있다고 할 때, 이는 "직접적으로 연결"되어 있는 경우뿐 아니라, 그 중간에 다른 소자를 사이에 두고 "전기적으로 연결"되어 있는 경우도 포함한다. 또한 어떤 부분이 어떤 구성요소를 "포함"한다고 할 때, 이는 특별히 반대되는 기재가 없는 한 다른 구성요소를 제외하는 것이 아니라 다른 구성요소를 더 포함할 수 있는 것을 의미한다. Throughout the specification, when a part is "connected" with another part, this includes not only the case of being "directly connected" but also the case of being "electrically connected" with another element interposed therebetween. . In addition, when a part "includes" a certain component, this means that other components may be further included, rather than excluding other components, unless otherwise stated.

본 명세서에 있어서 '부(部)'란, 하드웨어에 의해 실현되는 유닛(unit), 소프트웨어에 의해 실현되는 유닛, 양방을 이용하여 실현되는 유닛을 포함한다. 또한, 1 개의 유닛이 2 개 이상의 하드웨어를 이용하여 실현되어도 되고, 2 개 이상의 유닛이 1 개의 하드웨어에 의해 실현되어도 된다. In this specification, a "part" includes a unit realized by hardware, a unit realized by software, and a unit realized using both. In addition, one unit may be implemented using two or more hardware, and two or more units may be implemented by one hardware.

본 명세서에 있어서 단말 또는 디바이스가 수행하는 것으로 기술된 동작이나 기능 중 일부는 해당 단말 또는 디바이스와 연결된 서버에서 대신 수행될 수도 있다. 이와 마찬가지로, 서버가 수행하는 것으로 기술된 동작이나 기능 중 일부도 해당 서버와 연결된 단말 또는 디바이스에서 수행될 수도 있다. Some of the operations or functions described as being performed by the terminal or device in the present specification may be instead performed by a server connected to the terminal or device. Similarly, some of the operations or functions described as being performed by the server may also be performed in a terminal or device connected to the server.

이하, 첨부된 구성도 또는 처리 흐름도를 참고하여, 본 발명의 실시를 위한 구체적인 내용을 설명하도록 한다. Hereinafter, detailed contents for carrying out the present invention will be described with reference to the accompanying configuration diagram or process flow diagram.

도 1은 본 발명의 일 실시예에 따른 텍스트 감성 분석 장치의 구성을 나타낸 도면이고, 도 2는 본 발명의 일 실시예에 따른 감성 분석 모델의 구성을 나타낸 도면이다.1 is a diagram showing the configuration of a text sentiment analysis apparatus according to an embodiment of the present invention, and FIG. 2 is a diagram showing the configuration of a sentiment analysis model according to an embodiment of the present invention.

먼저, 도 1을 참조하면, 본 발명의 일 실시예에 따른 텍스트 감성 분석 장치(100)는 구축부(110) 및 분석부(130)를 포함할 수 있다.First, referring to FIG. 1 , the apparatus 100 for analyzing text sentiment according to an embodiment of the present invention may include a construction unit 110 and an analysis unit 130 .

구축부(110)는 입력되는 텍스트의 감성을 분석하기 위해 후술하는 감성 분석 모델(200)을 구축할 수 있다. 또한, 구축부(110)는 후술하는 감성 분석 모델(200)을 구성하는 완전 연결 계층(230)을 학습시키는 학습부(111)를 포함할 수 있다.The construction unit 110 may build a sentiment analysis model 200 to be described later in order to analyze the sentiment of the input text. In addition, the construction unit 110 may include a learning unit 111 for learning the fully connected layer 230 constituting the emotion analysis model 200 to be described later.

여기서, 감성 분석 모델이란, 텍스트 또는 텍스트에 포함되는 단어에 대해 해당 텍스트를 입력한 사용자의 감정과 관련된 정보를 판단하여 분석하는 텍스트 마이닝(Text mining) 모델일 수 있다.Here, the sentiment analysis model may be a text mining model that determines and analyzes information related to the emotion of a user who has input the text with respect to text or a word included in the text.

이어서, 이하에서는, 도 2를 참조하여 본 발명의 일 실시예에 따른 감성 분석 모델에 대해 설명하기로 한다.Next, a sentiment analysis model according to an embodiment of the present invention will be described with reference to FIG. 2 .

도 2를 참조하면, 본 발명에 따른 감성 분석 모델(200)은 입력되는 텍스트에 대한 감성 정보를 출력하는 것으로서, 임베딩 계층(210) 및 완전 연결 계층(230)을 포함할 수 있다.Referring to FIG. 2 , the sentiment analysis model 200 according to the present invention outputs sentiment information on input text, and may include an embedding layer 210 and a fully connected layer 230 .

임베딩 계층(210)은 복수의 단어를 포함하는 적어도 하나 이상의 문장들로 구성되는 텍스트를 입력받고, 적어도 하나 이상의 문장의 문맥에 기초하여 단어에 대한 임베딩 값을 산출할 수 있다.The embedding layer 210 may receive a text composed of one or more sentences including a plurality of words, and may calculate an embedding value for the word based on the context of the at least one or more sentences.

여기서, 임베딩 값이란, 텍스트를 컴퓨터에서 이용 가능하도록 수치화한 값을 의미할 수 있다. 한편, 임베딩 값은 계수 벡터화(Count vectorization) 및 용어빈도-역문서빈도(Term frequency-inverse document frequency)와 같은 계산식에 기초하여 산출될 수 있으나, 이에 한정되는 것은 아님에 유의하도록 한다.Here, the embedding value may mean a value obtained by digitizing text so that it can be used in a computer. Meanwhile, it should be noted that the embedding value may be calculated based on calculation formulas such as count vectorization and term frequency-inverse document frequency, but is not limited thereto.

임베딩 계층(210)은 임베딩 값을 산출하고자 하는 단어를 포함하는 문장과, 해당 문장의 앞뒤 중 적어도 하나에 위치하는 다른 문장 간의 접속사에 기초하여 문장의 문맥을 판단하도록 사전 학습될 수 있다.The embedding layer 210 may be pre-learned to determine the context of a sentence based on a conjunction between a sentence including a word for which an embedding value is to be calculated and another sentence positioned at at least one before and after the corresponding sentence.

여기서, 사전 학습이란 구축부(110)가 임베딩 계층(210) 및 완전 연결 계층(230)을 포함하는 감성 분석 모델(200)을 구축하기 이전에 임베딩 계층(210) 만이 별도의 모델로서 학습된 것을 의미할 수 있다.Here, prior learning means that only the embedding layer 210 is learned as a separate model before the building unit 110 builds the sentiment analysis model 200 including the embedding layer 210 and the fully connected layer 230. can mean

예를 들어, 임베딩 계층(210)은 "이 노래는 좋다. 그러나, 이 노래는 표절이다"라는 문장에서"이 노래는 좋다."라는 문장과 "이 노래는 표절이다."라는 문장 간의 "그러나,"라는 접속사에 기초하여 문장 간의 문맥을 판단하도록 사전 학습될 수 있다.For example, the embedding layer 210 may include "but this song is plagiarism" between the sentence "this song is good" and the sentence "this song is plagiarism" in the sentence "this song is good. It may be pre-learned to determine the context between sentences based on the conjunction of ",".

또한, 임베딩 계층(210)은 문장 중, 임베딩 값을 산출하고자 하는 단어와, 해당 단어의 앞뒤 중 적어도 하나에 위치하는 단어에 기초하여 문장의 문맥을 판단하도록 사전 학습될 수 있다.In addition, the embedding layer 210 may be pre-learned to determine the context of a sentence based on a word for which an embedding value is to be calculated and a word located in at least one of before and after the corresponding word among the sentences.

예를 들어, 임베딩 계층(210)은 "이 노래는 표절이다."라는 문장에서 임베딩 값을 산출하고자 하는 "노래"라는 단어와, "노래"라는 단어의 뒤에 위치하는 "표절"이라는 단어에 기초하여 문장의 문맥을 판단하도록 사전 학습될 수 있다.For example, the embedding layer 210 is based on the word "song" for which the embedding value is to be calculated in the sentence "This song is plagiarism" and the word "plagiarism" located after the word "song" Thus, it can be pre-learned to determine the context of the sentence.

이에 따라, 임베딩 계층(210)은 동일한 단어의 경우에도, 단어를 포함하는 문장의 문맥에 따라, 해당 단어에 대한 서로 다른 임베딩 값을 산출할 수 있다.Accordingly, even in the case of the same word, the embedding layer 210 may calculate different embedding values for the corresponding word according to the context of the sentence including the word.

한편, 임베딩 계층(210)은 트랜스포머(transformer) 기반의 4개의 은닉층으로 이루어진 적어도 하나 이상의 은닉 계층(211)을 포함할 수 있다.On the other hand, the embedding layer 210 may include at least one hidden layer 211 consisting of four hidden layers based on a transformer.

여기서, 트랜스포머란 RNN(Recurrent Neural Networks), LSTM(Long Short Term Memory) 셀을 이용하지 않고, 타임 시퀀스 역할을 하는 모델을 의미할 수 있다.Here, the transformer may mean a model serving as a time sequence without using Recurrent Neural Networks (RNN) or Long Short Term Memory (LSTM) cells.

즉, 임베딩 계층(210)은 적어도 하나 이상의 은닉 계층(211)을 이용하여 복수의 텍스트에 대한 임베딩 값을 병렬적으로 산출할 수 있다. 이에 대해선 아래에서 도 3을 참조하여 보다 구체적으로 설명하도록 한다.That is, the embedding layer 210 may calculate embedding values for a plurality of texts in parallel using at least one or more hidden layers 211 . This will be described in more detail with reference to FIG. 3 below.

완전 연결 계층(230)은 산출된 임베딩 값을 입력받고, 텍스트에 대한 감성 정보를 출력할 수 있다. 여기서, 완전 연결 계층(230)으로부터 출력되는 감성 정보는 예를 들어, 텍스트에 대한 긍정값 및 부정값을 포함할 수 있다.The fully connected layer 230 may receive the calculated embedding value and output sentiment information on the text. Here, the sentiment information output from the fully connected layer 230 may include, for example, positive values and negative values for text.

보다 구체적으로, 완전 연결 계층(230)은 전술한 임베딩 계층(210)에서 문맥에 기초하여 산출된 임베딩 값을 입력받고, 입력받은 임베딩 값에 기초하여 텍스트에 대한 긍정값 및 부정값을 포함하는 감성 정보를 출력할 수 있다. More specifically, the fully connected layer 230 receives the embedding value calculated on the basis of the context from the above-described embedding layer 210, and based on the received embedding value, sentiment including positive and negative values for text information can be printed.

예를 들어, 전술한 임베딩 계층(210)에서 "이 노래를 표절이다."라는 문장으로부터 "노래"라는 단어의 임베딩 값을 산출하는 경우, 임베딩 계층(210)은 "표절"이라는 부정적 단어에 기초하여 문장의 문맥을 판단한 후, "노래"라는 단어의 임베딩 값을 산출할 수 있고, 완전 연결 계층(230)은 이렇게 산출된 임베딩 값을 입력받아, "노래"라는 단어를 포함하는 텍스트에 감성 정보를 출력할 수 있으며, 이러한 경우, 출력되는 감성 정보에는 부정값이 포함될 수 있다.For example, when calculating the embedding value of the word "song" from the sentence "This song is plagiarism" in the embedding layer 210 described above, the embedding layer 210 is based on the negative word "plagiarism" After determining the context of the sentence, it is possible to calculate the embedding value of the word "song", and the fully connected layer 230 receives the calculated embedding value as input, and emotional information is provided in the text including the word "song". may be output, and in this case, the output emotion information may include a negative value.

한편, 완전 연결 계층(230)은 서로 다른 차원 수를 처리하는 3개의 계층으로 이루어질 수 있으며, 각 계층에서 산출된 임베딩 값을 순차적으로 입력받아, 입력된 임베딩 값의 차원 수를 순차적으로 감소시킬 수 있다.On the other hand, the fully connected layer 230 may consist of three layers that process different number of dimensions, and sequentially receive the embedding values calculated from each layer to sequentially reduce the number of dimensions of the input embedding values. have.

예를 들어, 임베딩 계층(210)은 100개의 은닉 계층(211)을 이용하여 100개의 텍스트에 대한 임베딩 값을 병렬적으로 산출할 수 있다. For example, the embedding layer 210 may calculate embedding values for 100 texts in parallel using 100 hidden layers 211 .

또한, 임베딩 계층(210)은 각 텍스트마다, 예를 들어, 768차원의 임베딩 값을 산출할 수 있고, 완전 연결 계층(230)은 이렇게 산출된 임베딩 값을 입력받은 후, 서로 다른 3개의 계층을 이용하여 임베딩 값의 차원 수를 순차적으로 감소시킬 수 있다.In addition, the embedding layer 210 may calculate an embedding value of, for example, 768 dimensions for each text, and the fully connected layer 230 receives the embedded value calculated in this way, and then creates three different layers. can be used to sequentially decrease the number of dimensions of the embedding value.

보다 구체적으로, 완전 연결 계층(230)은 임베딩 계층(210)으로부터 산출된 768차원의 임베딩 값을 입력받아, 임베딩 값의 차원을 64차원에서 16차원으로 순차적으로 감소시킬 수 있다. 이를 위해, 완전 연결 계층(230)은 임베딩 값의 차원을 64차원으로 감소시키는 제 1 완전 연결 계층 및 16차원으로 감소시키는 제 2 완전 연결 계층을 포함할 수 있다.More specifically, the fully connected layer 230 may receive the 768-dimensional embedding value calculated from the embedding layer 210 and sequentially decrease the dimension of the embedding value from 64 dimensions to 16 dimensions. To this end, the fully connected layer 230 may include a first fully connected layer that reduces the dimension of the embedding value to 64 dimensions and a second fully connected layer that reduces the dimension of the embedding value to 16 dimensions.

이때, 임베딩 계층(210)의 은닉 계층(211)의 개수는 텍스트 스트림 환경을 고려하여 임베딩 값의 데이터의 크기를 제한하기 위함일 수 있다. 따라서, 임베딩 계층(210)의 은닉 계층(211)의 수는 텍스트 스트림 환경을 고려하여 가변될 수 있다.In this case, the number of hidden layers 211 of the embedding layer 210 may be to limit the size of the data of the embedding value in consideration of the text stream environment. Accordingly, the number of hidden layers 211 of the embedding layer 210 may be varied in consideration of the text stream environment.

다시 도 1로 돌아와, 학습부(111)에 대해 설명하면, 학습부(111)는 적어도 하나의 완전 연결 계층(230)으로부터 출력된 감성 정보에 기초하여 임베딩 값에 따른 감성 정보 출력 결과를 완전 연결 계층에 학습시킬 수 있다.Returning to FIG. 1 again, when the learning unit 111 is described, the learning unit 111 completely connects the emotional information output result according to the embedding value based on the emotional information output from at least one fully connected layer 230 . It can be taught in layers.

예를 들어, 학습부(111)가 완전 연결 계층(230)에서 입력받은 임베딩 값과 해당 임베딩 값에 따른 감성 정보 출력 결과에 기초하여 완전 연결 계층(230)을 학습시킴으로써, 완전 연결 계층(230)은 입력받은 임베딩 값이 사전 학습된 임베딩 값이므로, 보다 신속하게 감성 정보를 출력할 수 있게 된다.For example, by learning the fully connected layer 230 based on the embedding value input from the fully connected layer 230 by the learning unit 111 and the emotional information output result according to the embedding value, the fully connected layer 230 . Since the received embedding value is a pre-learned embedding value, emotional information can be output more quickly.

즉, 임베딩 계층(210)은 문장 간의 접속사 또는 앞뒤 단어에 기초하여 문장의 문맥을 판단하도록 사전 학습되어, 사전 학습된 문맥에 기초하여 단어에 대한 임베딩 값을 산출할 수 있고, 완전 연결 계층(230)은 학습부(111)에 의해 학습된 텍스트별 감성 정보 출력 결과에 기초하여, 입력된 임베딩 값에 따른 감성 정보를 출력할 수 있다.That is, the embedding layer 210 is pre-learned to determine the context of a sentence based on a conjunction between sentences or words before and after, and may calculate an embedding value for a word based on the pre-learned context, and the fully connected layer 230 ) may output emotion information according to the input embedding value based on the result of outputting emotion information for each text learned by the learning unit 111 .

또한, 도 1을 참조하면, 분석부(130)는 감성 분석 모델을 이용하여 실시간으로 입력되는 텍스트에 대한 감성 정보를 분석할 수 있다.Also, referring to FIG. 1 , the analysis unit 130 may analyze emotion information on the text input in real time by using the emotion analysis model.

보다 구체적으로, 분석부(130)는 실시간으로 입력되는 텍스트를 구축부(110)에 의해 구축된 감성 분석 모델(200)에 입력할 수 있고, 감성 분석 모델(200)은 임베딩 계층(210) 및 완전 연결 계층(230)을 이용하여 입력되는 텍스트에 포함되는 단어에 대한 임베딩 값을 산출하고, 산출된 임베딩 값에 기초하여 해당 텍스트에 대한 감성 정보를 출력할 수 있으며, 분석부(130)는 이렇게 출력된 감성 정보에 기초하여 해당 텍스트에 대한 감성 정보를 분석할 수 있다.More specifically, the analysis unit 130 may input the text input in real time to the sentiment analysis model 200 built by the construction unit 110 , and the sentiment analysis model 200 includes the embedding layer 210 and An embedding value for a word included in the input text may be calculated using the fully connected layer 230 , and emotion information for the corresponding text may be output based on the calculated embedding value, and the analysis unit 130 is Based on the output emotion information, emotion information on the corresponding text may be analyzed.

이하에서는, 도 3을 참조하여 본 발명의 일 실시예에 따른 은닉 계층에 대해 설명하기로 한다.Hereinafter, a hidden layer according to an embodiment of the present invention will be described with reference to FIG. 3 .

도 3은 본 발명의 일 실시예에 따른 은닉 계층의 구성을 나타낸 도면이다.3 is a diagram illustrating the configuration of a hidden layer according to an embodiment of the present invention.

도 3을 참조하면, 임베딩 계층(210)을 구성하는 은닉 계층(211)은 적어도 하나 이상의 은닉층(300)의 조합으로 이루어질 수 있다.Referring to FIG. 3 , the hidden layer 211 constituting the embedding layer 210 may be formed of a combination of at least one or more hidden layers 300 .

여기서, 본 발명에 따른 은닉 계층(211)은 텍스트 마이닝을 위해 기설정된 텍스트 마이닝 모델에 포함된 은닉층 중 적어도 하나의 은닉층으로 구성될 수 있다.Here, the hidden layer 211 according to the present invention may be composed of at least one hidden layer among hidden layers included in a text mining model preset for text mining.

예를 들어, 기설정된 텍스트 마이닝 모델은 12개의 은닉층을 가지며, 임베딩 값을 산출하고자 하는 단어를 포함하는 문장과, 해당 문장의 앞뒤 중 적어도 하나에 위치하는 다른 문장 간의 접속사에 기초하여 문장의 문맥을 판단하도록 사전 학습될 수 있다.For example, the preset text mining model has 12 hidden layers, and the context of a sentence is determined based on a conjunction between a sentence including a word for which an embedding value is to be calculated and another sentence positioned at least one of the front and rear of the corresponding sentence. It can be pre-trained to judge.

이때, 본 발명에 따른 은닉 계층(211)은 해당 12개의 은닉층 중, 마지막 4개의 은닉층(300)의 조합으로 구성될 수 있다.In this case, the hidden layer 211 according to the present invention may be composed of a combination of the last four hidden layers 300 among the 12 hidden layers.

여기서, 본 발명에 따른 은닉 계층(211)이 기설정된 텍스트 마이닝 모델의 12개의 은닉층 중 마지막 4개의 은닉층(300)의 조합으로 이루어지는 것은, 실험 결과, 마지막 4개 은닉층(300)의 조합이 높은 감성 분석 정확도를 나타냈기 때문이다.Here, the hidden layer 211 according to the present invention is made of a combination of the last four hidden layers 300 among the 12 hidden layers of the preset text mining model, as a result of the experiment, the combination of the last four hidden layers 300 has a high sensitivity This is because the analysis accuracy was indicated.

예를 들어, 표 1을 참조하면, 본 발명에 따른 은닉 계층(211)이 마지막 4개의 은닉층(300)의 조합으로 이루어짐으로써, 가장 높은 감성 분석 정확도를 나타내는 것을 확인할 수 있다.For example, referring to Table 1, it can be seen that the hidden layer 211 according to the present invention is formed of a combination of the last four hidden layers 300, thereby exhibiting the highest sensitivity analysis accuracy.

은닉층 조합hidden layer combination Online 1000Online 1000 Online 10000Online 10000 Batch 1000Batch 1000 마지막 1개의은닉층의 조합Combination of the last one hidden layer 0.77960.7796 0.81830.8183 0.82820.8282 마지막 2개의은닉층의 조합Combination of the last two hidden layers 0.78310.7831 0.82380.8238 0.83410.8341 마지막 4개의은닉층의 조합Combination of the last 4 hidden layers 0.79230.7923 0.82410.8241 0.83650.8365 총 12개의은닉층의 조합Combination of a total of 12 hidden layers 0.71700.7170 0.82000.8200 0.81660.8166

즉, 본 발명에 따른 텍스트 감성 분석 장치(100)는 기설정된 텍스트 마이닝 모델의 마지막 4개의 은닉층(300)을 조합하여 임베딩 값을 산출함으로써, 보다 정확한 감성 분석이 가능한 감성 분석 모델을 구축할 수 있다.That is, the text sentiment analysis apparatus 100 according to the present invention calculates an embedding value by combining the last four hidden layers 300 of a preset text mining model, thereby constructing a sentiment analysis model capable of more accurate sentiment analysis. .

여기서, 각각의 은닉층(300)은, 예를 들어, 각각 768차원의 임베딩 값을 산출할 수 있다. 따라서, 임베딩 계층(210)은 은닉 계층(211)에 포함되는 4개의 은닉층(300)을 이용하여 각각의 텍스트에 대한 768차원의 임베딩 값을 병렬적으로 산출할 수 있다.Here, each hidden layer 300 may calculate, for example, 768-dimensional embedding values, respectively. Accordingly, the embedding layer 210 may calculate a 768-dimensional embedding value for each text in parallel using the four hidden layers 300 included in the hidden layer 211 .

이하에서는, 도 4를 참조하여 본 발명의 일 실시예에 따른 은닉층에 대해 설명하기로 한다.Hereinafter, a hidden layer according to an embodiment of the present invention will be described with reference to FIG. 4 .

도 4는 본 발명의 일 실시예에 따른 은닉층의 구성을 나타낸 도면이다.4 is a diagram showing the configuration of a hidden layer according to an embodiment of the present invention.

도 4를 참조하면, 은닉층(300)은 입력부(410), 가중치 할당부(430), 제 1 표준화 처리부(450), 피드 포워드부(470) 및 제 2 표준화 처리부(490)를 포함할 수 있다.Referring to FIG. 4 , the hidden layer 300 may include an input unit 410 , a weight assignment unit 430 , a first standardization processing unit 450 , a feed forward unit 470 , and a second standardization processing unit 490 . .

입력부(410)는 복수의 단어를 입력받을 수 있다.The input unit 410 may receive a plurality of words.

이때, 입력부(410)는 복수의 단어를 병렬적으로 입력받을 수 있되, 후술하는 순서 정보를 함께 입력 받음으로써, 병렬적으로 입력되는 복수의 단어를 순서대로 정렬한 상태로 입력받을 수 있다. In this case, the input unit 410 may receive a plurality of words in parallel, and by receiving order information to be described later together, may receive the input in a state in which a plurality of words input in parallel are arranged in order.

전술한 순서 정보에 대해서는 아래에서 가중치 할당부(430)를 설명하며 보다 구체적으로 설명하도록 한다.The above-described order information will be described in more detail by the weight allocator 430 below.

여기서, 순서 정보는 주기 함수로서, 포지셔널 인코딩(Positional Encoding)으로 구현될 수 있다.Here, the order information is a periodic function and may be implemented by positional encoding.

가중치 할당부(430)는 입력된 복수의 단어간의 가중치를 학습하여, 복수의 단어간의 순서 정보를 생성할 수 있다. 여기서, 가중치 할당부(430)가 가중치를 학습하는 것에 대해서는 아래에서 도 5를 참조하여 보다 구체적으로 설명하도록 한다.The weight allocator 430 may generate order information between the plurality of words by learning the input weights between the plurality of words. Here, the learning of the weight by the weight allocator 430 will be described in more detail with reference to FIG. 5 below.

예를 들어, 가중치 할당부(430)는 "신용"이라는 단어와 "대출"이라는 단어가 관계가 있음에 기초하여, 서로의 단어에 대해 가중치를 학습시킬 수 있고, 이렇게 학습된 가중치에 기초하여 두 단어에 대한 순서 정보를 생성할 수 있다.For example, the weight allocator 430 may learn weights for each other's words based on the relationship between the word "credit" and the word "loan", and based on the learned weight, You can create order information for words.

이때, 생성된 순서 정보는 전술한 입력부(410)로 입력될 수 있다. 즉, 입력부(410)는 "대출", "상환" 및 "신용"이라는 단어가 순서에 상관없이 입력되는 경우에도, 입력된 순서 정보에 기초하여, 순서에 상관없이 입력된 "대출", "상환" 및 "신용"이라는 단어를, "신용", "대출" 및 "상환"순으로 정렬하여 입력 받을 수 있다.In this case, the generated order information may be input to the above-described input unit 410 . That is, the input unit 410, even when the words "loan", "repayment" and "credit" are input regardless of the order, based on the input order information, "loan", "repayment" input regardless of the order " and "credit" may be input by sorting in the order of "credit", "loan" and "repayment".

이하에서는, 도 5를 참조하여 본 발명의 일 실시예에 따른 가중치 할당부에 대해 설명하기로 한다.Hereinafter, a weight allocator according to an embodiment of the present invention will be described with reference to FIG. 5 .

도 5는 본 발명의 일 실시예에 따른 가중치 할당부의 가중치 할당 방법을 나타낸 도면이다.5 is a diagram illustrating a weight allocation method of a weight allocator according to an embodiment of the present invention.

도 5를 참조하면, 본 발명에 따른 가중치 할당부(430)는 하나의 문장의 임베딩 값이 512차원인 경우, 이를 8 등분한 후, 3개의 가중치 처리부(510, 530, 550)에서 각각 64개의 벡터를 맡아 처리하도록 하며, 이렇게 처리된 벡터 처리 값을 연산부(570)에 입력시킴으로써, 복수의 단어 간의 가중치를 산출하도록 학습될 수 있다.Referring to FIG. 5 , when the embedding value of one sentence is 512-dimensional, the weight allocator 430 according to the present invention divides it into 8 equal parts, and then uses the three weight processing units 510 , 530 , and 550 to assign 64 values, respectively. By taking the vector and processing it, and inputting the processed vector processing value to the operation unit 570 , it can be learned to calculate a weight between a plurality of words.

즉, 도 5에 나타낸 것과 같이, "Je suis ιtudiant"라는 문장의 임베딩 벡터가 512차원이라면, 이를 8 등분한 후, 64개의 벡터를 각각 하나의 가중치 처리부(510, 530, 550)에서 맡아 처리하도록 하며, 이렇게 처리된 벡터 처리 값을 연산부(570)에 입력시킨다.That is, as shown in FIG. 5, if the embedding vector of the sentence "Je suis ιtudiant" is 512-dimensional, it is divided into 8 equal parts, and then 64 vectors are handled by one weight processing unit (510, 530, 550). and input the processed vector processing value to the operation unit 570 .

여기서, 연산부(570)는 아래 수학식 1에 나타낸 것처럼, 두 개의 가중치 처리부(510 및 530)의 벡터 처리 값을 내적한 후, 활성화 함수에 입력하고, 이 후 가중치 처리부(550)에서 출력된 값을 곱하여 가중치를 산출할 수 있다.Here, as shown in Equation 1 below, the calculation unit 570 does the dot product of the vector processing values of the two weight processing units 510 and 530 , and then inputs them to the activation function, and then the value output from the weight processing unit 550 . The weight can be calculated by multiplying by .

Figure 112019055347738-pat00001
Figure 112019055347738-pat00001

다시 도 4를 참조하면, 제 1 표준화 처리부(450)는 가중치가 학습된 복수의 단어를 1차 표준화 처리하여, 단어 값을 산출할 수 있다. 즉, 제 1 표준화 처리부(450)는 입력부(410)를 통해 입력된 복수의 단어를 컴퓨터 프로그램에서 이용 가능한 단어 값으로 표준화 처리할 수 있다.Referring back to FIG. 4 , the first standardization processing unit 450 may calculate a word value by performing a primary standardization process on a plurality of words whose weights have been learned. That is, the first standardization processing unit 450 may standardize the plurality of words input through the input unit 410 as word values usable in the computer program.

피드 포워드부(470)는 표준화 처리된 단어 값을 후술하는 제 2 표준화 처리부(490)로 전달할 수 있다. The feed forward unit 470 may transmit the standardized word value to a second standardization processing unit 490 to be described later.

이때, 피드 포워드부(470)는 1차 표준화 처리된 단어 값에 기초하여 제 2 표준화 처리부(490)의 2차 표준화 처리를 제어할 수 있다. In this case, the feed forward unit 470 may control the secondary standardization processing of the second standardization processing unit 490 based on the first standardized word value.

즉, 피드 포워드부(470)는 제 2 표준화 처리부(490)의 2차 표준화 처리된 단어 값이 목적 값에 속하지 않는 경우, 보다 신속히 이를 제어하여 단어 값에 오류가 발생하는 것을 방지할 수 있다.That is, when the word value processed by the second standardization of the second standardization processing unit 490 does not belong to the target value, the feed forward unit 470 may control it more quickly to prevent an error in the word value.

제 2 표준화 처리부(490)는 피드 포워드부(470)를 통해 전달된 1차 표준화 처리된 단어 값을 2차 표준화 처리할 수 있다.The second standardization processing unit 490 may perform secondary standardization processing on the first standardized word value transmitted through the feed forward unit 470 .

즉, 제 2 표준화 처리부(490)는 제 1 표준화 처리부(450)를 통해 1차 표준화 처리된 단어값을 실제 컴퓨터 프로그램에서 이용하는 단어 값으로 표준화 처리할 수 있다.That is, the second standardization processing unit 490 may standardize the word value first standardized through the first standardization processing unit 450 into a word value used in an actual computer program.

이하에서는 도 6을 참조하여 본 발명의 일 실시예에 따른 텍스트 감성 분석 방법을 설명하기로 한다.Hereinafter, a text sentiment analysis method according to an embodiment of the present invention will be described with reference to FIG. 6 .

도 6은 본 발명의 일 실시예에 따른 텍스트 감성 분석 방법의 흐름을 나타낸 도면이다.6 is a diagram illustrating a flow of a text sentiment analysis method according to an embodiment of the present invention.

도 6을 참조하면, 본 발명의 일 실시예에 따른 텍스트 감성 분석 방법은 먼저, 단계 S610에서 구축부(110)가 감성 분석 모델(200)을 구축한다.Referring to FIG. 6 , in the text sentiment analysis method according to an embodiment of the present invention, first, the building unit 110 builds the sentiment analysis model 200 in step S610 .

단계 S630에서 분석부(130)는 구축된 감성 분석 모델(200)을 이용하여 실시간으로 입력되는 텍스트에 대한 감성 정보를 분석한다.In step S630 , the analysis unit 130 analyzes emotion information on the text input in real time using the built emotion analysis model 200 .

상술한 설명에서, 단계 S610 내지 S630은 본 발명의 구현예에 따라서, 추가적인 단계들로 더 분할되거나, 더 적은 단계들로 조합될 수 있다. 또한, 일부 단계는 필요에 따라 생략될 수도 있고, 단계 간의 순서가 변경될 수도 있다.In the above description, steps S610 to S630 may be further divided into additional steps or combined into fewer steps according to an embodiment of the present invention. In addition, some steps may be omitted as necessary, and the order between steps may be changed.

이하에서는 도 7을 참조하여 본 발명의 일 실시예에 따른 감성모델 구축 방법을 설명하기로 한다.Hereinafter, a method of constructing an emotion model according to an embodiment of the present invention will be described with reference to FIG. 7 .

도 7은 본 발명의 일 실시예에 따른 감성 분석 모델 구축 방법의 흐름을 나타낸 도면이다.7 is a diagram illustrating a flow of a method for constructing a sentiment analysis model according to an embodiment of the present invention.

도 7을 참조하면, 본 발명의 일 실시예에 따른 감성 분석 모델 구축 방법은 먼저, 단계 S710에서 임베딩 계층(210)은 복수의 단어를 포함하는 적어도 하나 이상의 문장들로 구성되는 텍스트를 입력받고, 적어도 하나 이상의 문장의 문맥에 기초하여 단어에 대한 임베딩 값을 산출한다.Referring to FIG. 7 , in the method for constructing a sentiment analysis model according to an embodiment of the present invention, first, in step S710, the embedding layer 210 receives a text composed of at least one sentence including a plurality of words, An embedding value for a word is calculated based on the context of at least one sentence or more.

단계 S730에서 완전 연결 계층(230)은 산출된 임베딩 값을 입력받고, 텍스트에 대한 감성 정보를 출력한다.In step S730, the fully connected layer 230 receives the calculated embedding value and outputs emotional information about the text.

단계 S750에서 학습부(111)는 임베딩 값에 따른 감성 정보 출력 결과에 기초하여 적어도 하나의 완전 연결 계층(230)을 학습시킨다.In step S750, the learning unit 111 learns at least one fully connected layer 230 based on the emotional information output result according to the embedding value.

상술한 설명에서, 단계 S710 내지 S750은 본 발명의 구현예에 따라서, 추가적인 단계들로 더 분할되거나, 더 적은 단계들로 조합될 수 있다. 또한, 일부 단계는 필요에 따라 생략될 수도 있고, 단계 간의 순서가 변경될 수도 있다.In the above description, steps S710 to S750 may be further divided into additional steps or combined into fewer steps, according to an embodiment of the present invention. In addition, some steps may be omitted as necessary, and the order between steps may be changed.

전술한 본 발명의 설명은 예시를 위한 것이며, 본 발명이 속하는 기술분야의 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고서 다른 구체적인 형태로 쉽게 변형이 가능하다는 것을 이해할 수 있을 것이다. 그러므로 이상에서 기술한 실시예들은 모든 면에서 예시적인 것이며 한정적이 아닌 것으로 이해해야만 한다. 예를 들어, 단일형으로 설명되어 있는 각 구성 요소는 분산되어 실시될 수도 있으며, 마찬가지로 분산된 것으로 설명되어 있는 구성 요소들도 결합된 형태로 실시될 수 있다. The above description of the present invention is for illustration, and those of ordinary skill in the art to which the present invention pertains can understand that it can be easily modified into other specific forms without changing the technical spirit or essential features of the present invention. will be. Therefore, it should be understood that the embodiments described above are illustrative in all respects and not restrictive. For example, each component described as a single type may be implemented in a distributed manner, and likewise components described as distributed may be implemented in a combined form.

본 발명의 범위는 상세한 설명보다는 후술하는 특허청구범위에 의하여 나타내어지며, 특허청구범위의 의미 및 범위 그리고 그 균등 개념으로부터 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.The scope of the present invention is indicated by the following claims rather than the detailed description, and all changes or modifications derived from the meaning and scope of the claims and their equivalent concepts should be construed as being included in the scope of the present invention. .

100: 텍스트 감성 분석 장치
110: 구축부
111: 학습부
130: 분석부
200: 감성 분석 모델
210: 임베딩 계층
211: 은닉 계층
230: 완전 연결 계층
300: 은닉층
410: 입력부
430: 가중치 할당부
450: 제 1 표준화 처리부
470: 피드 포워드부
490: 제 2 표준화 처리부
100: text sentiment analysis device
110: construction unit
111: study department
130: analysis unit
200: sentiment analysis model
210: embedding layer
211: hidden layer
230: fully connected layer
300: hidden layer
410: input unit
430: weight allocator
450: first standardization processing unit
470: feed forward unit
490: second standardization processing unit

Claims (14)

텍스트에 대한 감성 분석을 수행하는 텍스트 감성 분석 장치에 있어서,
복수의 단어를 포함하는 적어도 하나 이상의 문장들로 구성되는 텍스트를 입력받고, 상기 적어도 하나 이상의 문장의 문맥에 기초하여 상기 단어에 대한 임베딩 값을 산출하는 임베딩 계층 및 상기 산출된 임베딩 값을 입력받고, 상기 텍스트에 대한 감성 정보를 출력하는 적어도 하나의 완전 연결 계층을 포함하는 감성 분석 모델을 구축하는 구축부; 및
상기 구축된 감성 분석 모델을 이용하여 실시간으로 입력되는 텍스트에 대한 감성 정보를 분석하는 분석부를 포함하되,
상기 임베딩 계층은 복수의 문장의 문맥에 기초하여 단어에 대한 임베딩 값을 산출하도록 사전 학습된 것인, 텍스트 감성 분석 장치.
In the text sentiment analysis apparatus for performing sentiment analysis on text,
Receives a text composed of one or more sentences including a plurality of words, receives an embedding layer for calculating an embedding value for the word based on the context of the at least one or more sentences, and receives the calculated embedding value, a construction unit for constructing a sentiment analysis model including at least one fully connected layer for outputting sentiment information for the text; and
Comprising an analysis unit that analyzes emotion information about the text input in real time using the built-up emotion analysis model,
The embedding layer is pre-trained to calculate an embedding value for a word based on the context of a plurality of sentences, a text sentiment analysis apparatus.
제 1 항에 있어서,
상기 구축부는 상기 적어도 하나의 완전 연결 계층이 상기 텍스트에 대한 감성 정보를 출력하도록 상기 적어도 하나의 완전 연결 계층만을 학습시키는 학습부를 포함하는 것인, 텍스트 감성 분석 장치.
The method of claim 1,
Wherein the building unit comprises a learning unit for learning only the at least one fully connected layer so that the at least one fully connected layer outputs the emotional information for the text.
제 1 항에 있어서,
상기 임베딩 계층은 상기 임베딩 값을 산출하고자 하는 상기 단어를 포함하는 상기 문장과, 상기 문장의 앞뒤 중 적어도 하나에 위치하는 문장간의 접속사에 기초하여 상기 문장의 문맥을 판단하도록 사전 학습된 것인, 텍스트 감성 분석 장치.
The method of claim 1,
The embedding layer is pre-learned to determine the context of the sentence based on a conjunction between the sentence including the word for which the embedding value is to be calculated and the sentence positioned at least one before and after the sentence. Sentiment Analysis Device.
제 1 항에 있어서,
상기 임베딩 계층은 상기 문장 중, 상기 임베딩 값을 산출하고자 하는 상기 단어와, 상기 단어의 앞뒤 중 적어도 하나에 위치하는 단어에 기초하여 상기 문장의 문맥을 판단하도록 사전 학습된 것인, 텍스트 감성 분석 장치.
The method of claim 1,
The embedding layer is pre-learned to determine the context of the sentence based on the word for which the embedding value is to be calculated among the sentences and the word positioned before and after at least one of the word, the text sentiment analysis apparatus .
제 1 항에 있어서,
상기 임베딩 계층은 계수 벡터화(Count vectorization) 및 용어빈도-역문서빈도(Term frequency-inverse document frequency) 중 어느 하나를 이용하여 상기 단어를 수치화한 값인 상기 임베딩 값을 산출하는 것인, 텍스트 감성 분석 장치.
The method of claim 1,
The embedding layer calculates the embedding value, which is a value obtained by digitizing the word using any one of count vectorization and term frequency-inverse document frequency, text sentiment analysis apparatus .
제 1 항에 있어서,
상기 임베딩 계층은 트랜스포머 기반의 4개의 은닉층으로 이루어진 적어도 하나 이상의 은닉 계층을 포함하는 것인, 텍스트 감성 분석 장치.
The method of claim 1,
The embedding layer will include at least one or more hidden layers consisting of four transformer-based hidden layers, the text sentiment analysis apparatus.
제 6 항에 있어서,
상기 은닉층은 상기 복수의 단어를 입력받는 입력부;
상기 복수의 단어 간의 가중치를 학습하는 가중치 할당부; 및
상기 가중치가 학습된 복수의 단어를 1차 표준화 처리하는 제 1 표준화 처리부; 및
상기 표준화 처리된 복수의 단어에 대한 단어 값을 전달하는 피드 포워드부를 포함하는 것인, 텍스트 감성 분석 장치.
7. The method of claim 6,
The hidden layer may include an input unit for receiving the plurality of words;
a weight allocator for learning weights between the plurality of words; and
a first standardization processing unit for performing primary standardization of the plurality of words whose weights have been learned; and
The text sentiment analysis apparatus comprising a feed forward unit for transmitting word values for the plurality of standardized words.
제 7 항에 있어서,
상기 가중치 할당부는 상기 복수의 단어 간의 가중치를 학습하여 상기 복수의 단어간의 순서 정보를 생성하고,
상기 입력부는 상기 복수의 단어 간의 순서 정보를 추가로 입력받는 것인, 텍스트 감성 분석 장치.
8. The method of claim 7,
The weight allocator learns a weight between the plurality of words to generate order information between the plurality of words,
Wherein the input unit additionally receives the order information between the plurality of words, text sentiment analysis apparatus.
제 7 항에 있어서,
상기 은닉층은 상기 피드 포워드부를 통해 전달된 상기 1차 표준화 처리된 단어 값을 2차 표준화 처리하는 제 2 표준화 처리부를 더 포함하고,
상기 피드 포워드부는 상기 1차 표준화 처리된 단어 값에 기초하여 상기 제 2 표준화 처리부의 상기 2차 표준화 처리를 제어하는 것인, 텍스트 감성 분석 장치.
8. The method of claim 7,
The hidden layer further includes a second standardization processing unit that performs secondary normalization processing on the first standardized word value transmitted through the feed forward unit,
Wherein the feed forward unit controls the secondary standardization processing of the second standardization processing unit based on the first standardized word value, text sentiment analysis apparatus.
제 6 항에 있어서,
상기 은닉 계층은 4개의 상기 은닉층을 이용하여 입력되는 복수의 텍스트를 병렬 처리하는 것인, 텍스트 감성 분석 장치.
7. The method of claim 6,
The hidden layer is a text sentiment analysis apparatus that parallelly processes a plurality of texts input using the four hidden layers.
텍스트 감성 분석 장치에 의해 수행되는 텍스트에 대한 감성 분석을 수행하는 텍스트 감성 분석 방법에 있어서,
감성 분석 모델을 구축하는 단계; 및
상기 구축된 감성 분석 모델을 이용하여 실시간으로 입력되는 텍스트에 대한 감성 정보를 분석하는 단계를 포함하되,
상기 감성 분석 모델을 구축하는 단계는,
복수의 단어를 포함하는 적어도 하나 이상의 문장들로 구성되는 텍스트를 입력받고, 상기 적어도 하나 이상의 문장의 문맥에 기초하여 상기 단어에 대한 임베딩 값을 산출하는 단계; 및
상기 산출된 임베딩 값을 입력받고, 상기 텍스트에 대한 감성 정보를 출력하는 단계를 포함하고,
상기 단어에 대한 임베딩 값의 산출은 복수의 문장의 문맥에 기초하여 단어에 대한 임베딩 값을 산출하도록 한 사전 학습에 기초한 것인, 텍스트 감성 분석 방법.
A text sentiment analysis method for performing sentiment analysis on text performed by a text sentiment analysis apparatus, the method comprising:
building a sentiment analysis model; and
Including the step of analyzing sentiment information about the text input in real time using the built-up sentiment analysis model,
The step of constructing the sentiment analysis model is,
receiving a text composed of one or more sentences including a plurality of words, and calculating an embedding value for the word based on a context of the at least one or more sentences; and
receiving the calculated embedding value and outputting emotional information about the text;
The calculation of the embedding value for the word is based on dictionary learning to calculate the embedding value for the word based on the context of a plurality of sentences.
제 11 항에 있어서,
상기 구축하는 단계는 적어도 하나의 완전 연결 계층이 상기 텍스트에 대한 감성 정보를 출력하도록 상기 적어도 하나의 완전 연결 계층만을 학습시키는 단계를 포함하는 것인, 텍스트 감성 분석 방법.
12. The method of claim 11,
Wherein the constructing comprises learning only the at least one fully connected layer so that the at least one fully connected layer outputs sentiment information for the text.
제 11 항에 있어서,
상기 단어에 대한 임베딩 값의 산출은 상기 임베딩 값을 산출하고자 하는 상기 단어를 포함하는 상기 문장과, 상기 문장의 앞뒤 중 적어도 하나에 위치하는 문장 간의 접속사 또는 상기 임베딩 값을 산출하고자 하는 상기 단어와, 상기 단어의 앞뒤 중 적어도 하나에 위치하는 단어에 기초하여 상기 문장의 문맥을 판단하도록 한 사전 학습에 기초한 것인, 텍스트 감성 분석 방법.
12. The method of claim 11,
Calculation of the embedding value for the word is a conjunction between the sentence including the word for which the embedding value is to be calculated, and a sentence positioned at least one of front and back of the sentence or the word for which the embedding value is to be calculated; The text sentiment analysis method, which is based on dictionary learning to determine the context of the sentence based on a word positioned at least one of the front and rear of the word.
제 11 항에 있어서,
상기 단어에 대한 임베딩 값을 산출하는 단계는 트랜스포머 기반의 4개의 은닉층으로 이루어진 적어도 하나 이상의 은닉 계층을 이용하여 상기 단어에 대한 임베딩 값을 산출하는 단계를 포함하되,
상기 은닉층은 상기 텍스트로부터 복수의 단어를 입력받고, 상기 복수의 단어 간의 순서 정보를 추가로 입력받고,
상기 복수의 단어 간의 가중치를 학습하고, 상기 복수의 단어 간의 순서 정보를 생성하고,
상기 가중치가 학습된 복수의 단어를 1차 표준화 처리하고,
상기 표준화 처리된 복수의 단어에 대한 단어 값을 전달하고,
상기 1차 표준화 처리된 단어 값을 2차 표준화 처리하는 것인, 텍스트 감성 분석 방법.
12. The method of claim 11,
Calculating the embedding value for the word includes calculating the embedding value for the word using at least one or more hidden layers including four hidden layers based on a transformer,
The hidden layer receives a plurality of words from the text and additionally receives order information between the plurality of words,
learning a weight between the plurality of words, generating order information between the plurality of words,
Primary standardization processing of the plurality of words whose weights have been learned,
transfer the word values for the plurality of standardized words,
A text sentiment analysis method of secondary standardization of the first standardized word value.
KR1020190063386A 2019-05-29 2019-05-29 Text sensibility analysis apparatus and method threrof KR102326473B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020190063386A KR102326473B1 (en) 2019-05-29 2019-05-29 Text sensibility analysis apparatus and method threrof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020190063386A KR102326473B1 (en) 2019-05-29 2019-05-29 Text sensibility analysis apparatus and method threrof

Publications (2)

Publication Number Publication Date
KR20200137290A KR20200137290A (en) 2020-12-09
KR102326473B1 true KR102326473B1 (en) 2021-11-15

Family

ID=73786857

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020190063386A KR102326473B1 (en) 2019-05-29 2019-05-29 Text sensibility analysis apparatus and method threrof

Country Status (1)

Country Link
KR (1) KR102326473B1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110112825A1 (en) 2009-11-12 2011-05-12 Jerome Bellegarda Sentiment prediction from textual data
KR101136007B1 (en) * 2010-06-29 2012-04-20 (주)워드워즈 System and method for anaylyzing document sentiment
KR101625787B1 (en) 2015-02-02 2016-05-30 숭실대학교산학협력단 Method and server for estimating the sentiment value of word
WO2016085409A1 (en) 2014-11-24 2016-06-02 Agency For Science, Technology And Research A method and system for sentiment classification and emotion classification

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101503802B1 (en) * 2013-02-26 2015-03-19 (주)아크릴 Method for providing sensitivity pattern and device performing the same
KR101842362B1 (en) * 2016-09-01 2018-03-26 성균관대학교산학협력단 An apparatus for generating paragraph based on artificial neural network and method thereof

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110112825A1 (en) 2009-11-12 2011-05-12 Jerome Bellegarda Sentiment prediction from textual data
KR101136007B1 (en) * 2010-06-29 2012-04-20 (주)워드워즈 System and method for anaylyzing document sentiment
WO2016085409A1 (en) 2014-11-24 2016-06-02 Agency For Science, Technology And Research A method and system for sentiment classification and emotion classification
KR101625787B1 (en) 2015-02-02 2016-05-30 숭실대학교산학협력단 Method and server for estimating the sentiment value of word

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
신승엽외 1명, "감성분석을 위한 문맥 기반 임베딩을 이용한 온라인 딥러닝 기법", 데이터베이스연구 2019 제35권 제1호, 2019.04., pp.86-95. 1부.*

Also Published As

Publication number Publication date
KR20200137290A (en) 2020-12-09

Similar Documents

Publication Publication Date Title
US11288444B2 (en) Optimization techniques for artificial intelligence
US11308405B2 (en) Human-computer dialogue method and apparatus
US20210216723A1 (en) Classification model training method, classification method, device, and medium
Rani et al. Deep learning based sentiment analysis using convolution neural network
Bergsma et al. Language identification for creating language-specific twitter collections
Schick et al. BERTRAM: Improved word embeddings have big impact on contextualized model performance
CN114676704B (en) Sentence emotion analysis method, device and equipment and storage medium
CN111538841B (en) Comment emotion analysis method, device and system based on knowledge mutual distillation
Štajner et al. Shared task on quality assessment for text simplification
RU2730449C2 (en) Method of creating model for analysing dialogues based on artificial intelligence for processing user requests and system using such model
CN106294718A (en) Information processing method and device
Narayanaswamy Exploiting BERT and RoBERTa to improve performance for aspect based sentiment analysis
CN108776864A (en) The appraisal procedure and device of user comment value
KR102410715B1 (en) Apparatus and method for analyzing sentiment of text data based on machine learning
KR102326473B1 (en) Text sensibility analysis apparatus and method threrof
US11457110B2 (en) Interactive voice response system with a real time conversation scoring module
US20220366133A1 (en) Training a Model in a Data-Scarce Environment Using Added Parameter Information
Shah et al. A study of various word embeddings in deep learning
Kang et al. Sentiment analysis on Malaysian airlines with BERT
Zeng et al. RACMF: robust attention convolutional matrix factorization for rating prediction
Lopez-Gazpio et al. iubc at semeval-2016 task 2: Rnns and lstms for interpretable sts
Dai et al. Multilingual word embedding for zero-shot text classification
Rodrigues et al. Sentence similarity recognition in Portuguese from multiple embedding models
Xiang et al. A novel sentiment analysis method based on multi-scale deep learning
Kavitha Twitter sentiment analysis based on adaptive deep recurrent neural network

Legal Events

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