• 검색 결과가 없습니다.

LSTM 기반의 sequence-to-sequence 모델을 이용한 한글 자동 띄어쓰기

N/A
N/A
Protected

Academic year: 2022

Share "LSTM 기반의 sequence-to-sequence 모델을 이용한 한글 자동 띄어쓰기"

Copied!
7
0
0

로드 중.... (전체 텍스트 보기)

전체 글

(1)

LSTM 기반의 sequence-to-sequence 모델을 이용한 한글 자동 띄어쓰기

(LSTM based sequence-to-sequence Model for Korean Automatic Word-spacing)

이태석

*

, 강승식

**

(Tae Seok Lee, Seung Shik Kang)

자동 띄어쓰기 특성을 효과적으로 처리할 수 있는 LSTM(Long Short-Term Memory Neural Networks) 기반의 RNN 모 델을 제시하고 적용한 결과를 분석하였다. 문장이 길거나 일부 노이즈가 포함된 경우에 신경망 학습이 쉽지 않은 문제를 해결하 기 위하여 입력 데이터 형식과 디코딩 데이터 형식을 정의하고, 신경망 학습에서 드롭아웃, 양방향 다층 LSTM 셀, 계층 정규화 기법, 주목 기법(attention mechanism)을 적용하여 성능을 향상시키는 방법을 제안하였다. 학습 데이터로는 세종 말뭉치 자료 를 사용하였으며, 학습 데이터가 부분적으로 불완전한 띄어쓰기가 포함되어 있었음에도 불구하고, 대량의 학습 데이터를 통해 한글 띄어쓰기에 대한 패턴이 의미 있게 학습되었다. 이것은 신경망에서 드롭아웃 기법을 통해 학습 모델의 오버피팅이 되지 않도록 함으로써 노이즈에 강한 모델을 만들었기 때문이다. 실험결과로 LSTM sequence-to-sequence 모델이 재현율과 정확 도를 함께 고려한 평가 점수인 F1 값이 0.94로 규칙 기반 방식과 딥러닝 GRU-CRF보다 더 높은 성능을 보였다.

■ 중심어 : 인코딩-디코딩; sequence-to-sequence; LSTM; 순차정보 신경망; 자동 띄어쓰기; 드롭아웃; 계층 정 규화

We proposed a LSTM-based RNN model that can effectively perform the automatic spacing characteristics. For those long or noisy sentences which are known to be difficult to handle within Neural Network Learning, we defined a proper input data format and decoding data format, and added dropout, bidirectional multi-layer LSTM, layer normalization, and attention mechanism to improve the performance. Despite of the fact that Sejong corpus contains some spacing errors, a noise-robust learning model developed in this study with no overfitting through a dropout method helped training and returned meaningful results of Korean word spacing and its patterns. The experimental results showed that the performance of LSTM sequence-to-sequence model is 0.94 in F1-measure, which is better than the rule-based deep-learning method of GRU-CRF.

■ keywords : encoding-decoding; LSTM; sequence-to-sequence neural network; auto spacing; drop-out; layer normalization

* 정회원: KISTI 책임연구원

** 정회원: 국민대학교 컴퓨터공학부 교수(교신저자)

이 논문은 2017년도 정부(교육부)의 재원으로 한국연구재단의 지원을 받아 수행된 기초연구사업임(

No. NRF-2017R1D1A1B03036409

).

이 논문은 한국과학기술정보연구원(KISTI) 주요사업 과제로 수행한 것임.

접수일자 : 2018년 09월 27일 수정일자 : 2018년 11월 07일

게재확정일 : 2018년 11월 08일

교신저자 : 강승식 e-mail : sskang@kookmin.ac.kr

Ⅰ . 서 론

자동 띄어쓰기(automatic word spacing or word segmentation)는 중국어나 일본어처럼 띄어쓰기를 하지 않는 언어에서 자연어 처리를 위해 해야 하는 기본 작업이다. 따라서 이들 언어권에서는 문장에서 단어를 구분하는 연구가 많이 진 행되었다. 어절 단위로 띄어 쓰는 한국어의 경우 상대적으로 중 요성이 낮지만, 문자인식이나 음성인식의 경우 노이즈 등의 이 유로 공백을 인식하지 못하는 오류가 빈번히 발생한다. 이 경우

띄어쓰기가 되지 않은 문장의 띄어쓰기 교정 성능이 자연어처 리 성능에 큰 영향을 준다. 따라서 실제 문장에 대해서 띄어쓰 기 오류를 제거하는 자동 띄어쓰기 단계의 도입이 필요하다[1, 2].

중국어의 단어 분리(word segmentation)는 시퀀스 라벨링 문제(sequence labeling problem)로 보고 문자 단위로 처리하 는 방식을 사용하고 있다. 문장에서 기준 위치를 이동하면서 고 정길이 전후문자(context window)들로부터 단어를 조합하는 이진트리 구조에서 게이트 순환 신경망을 통해 조합하는 방식 에서 LSTM 신경망(Long Short-Term Memory Neural

(2)

 

  

<s>

A B C

W X Y Z </s>

W X Y Z

decoding encoding

(3)



<s>

A B C

W X Y Z </s>

W X Y Z

Stacked LSTM cell for decoding Stacked LSTM cell for encoding



∼  self-recurrent

connection output

input gate output gate

forget gate

input

 

  

 

  

 

  

 tanh 

  

 ∘



  

 ∘ tanh 

...

...

...

Layer-1 Layer-2 Layer-3

...

...

...

...

...

(4)

attention

a

c attention weighted context vector attention weight

...

encoding time steps decoding time steps ...

st-1 st

... ...

...

...



 









 ′

′

 tanh 

 

  

for

  

 

 tanh 



′ 

 tanh 

   

 tanh 

  

   

′ tanh 





′ ′

...

...

...

Attention Layer

Layer-1 Layer-2 Layer-3

at

...

...

...

...

ct

...

Attention weighted context vector Attention weight

...

(5)

Set up parameters Values learning rate 0.5 decay rate ( )ρ 0.99 constant value( )ε 1e-08

1) 한국어의 원시 문장 말뭉치로는 http://nlp.kookmin.ac.kr/kcc와 http://konltk.org/에 공개되어 있는 1 8억 천만 어절 규모 약 ( 만 문장 의 말뭉치가 그 규모가 가장 크고 신뢰 1,330 ) KCC150

도가 높다 다만. , KCC150은 최근에 공개되어 논문 실험 과정에 서 사용할 수가 없었기 때문에 세종말뭉치를 사용하였다.

2) ACL(Association for Computational Linguistics)

3) DUC(Document Understanding Conference)

4) ROUGE(Recall-Oriented Understudy for Gisting Evaluation)

Set up parameters 1st Values 2nd Values

batch size 20 200

LSTM layers 1 3

max encoding timesteps 100 100 max decoding timesteps 120 120

min input length 2 2

hidden node size for rnn

cell 100 200

embedding dimension 100 100 using layer normalization no yes

using dropout no 0.8

analyzing method syllables syllables

Measurement fields 1st Results 2nd Results Average recall 0.77994 0.94279 Average precision 0.75676 0.93720 Average F1 value 0.76818 0.93999 원래형태: 못한 가족이 수 없이 많다 하루속히 통일이 되어 이런 일이.

입력형태: 못한가족이수없이많다 하루속히통일이되어이런일이.

정답형태: N N Y N N N Y N Y N N Y N N N Y N N N N Y N N N Y N N Y N N Y N N 예측형태: N N N N N Y N Y N N Y N N N Y N N N N Y N N N Y N N Y N N N N 출력형태: 못한가족이 수 없이 많다 하루속히 통일이 되어 이런일이.

0.940 0.928

0.0151 0.0120 0.0000 0.0200 0.0400 0.0600 0.0800 0.1000 0.1200 0.1400

0.000 0.100 0.200 0.300 0.400 0.500 0.600 0.700 0.800 0.900 1.000

2.1 3.6 5.4 8.8 19 22.3 28.9 F1 loss

epoch F1

loss

(6)
(7)

참조

관련 문서

The analyzed DNA sequence data from the non-human blood stain was submitted to GenBank database to search the matching sequence using BLAST program.. The cyt b sequence of

Although in New Zealand there are many undescribed species of Pyropia still to be formally described that have been distinguished on the basis of molecular sequence

The Cell State of the LSTM means an area to decide what data to memorize, by comparing previous output with current input and the Hidden State means an area

To reduce the volume of data to be transmitted for a network, the Master-Auxiliary Concept sends full correction and coordinate information for a single reference station,

includes the following steps. 1) Data preprocessing: this step mainly includes the URL format examination, HTML structured regularization, and HTML tag format tidiness and

For addressing this issue, we are proposing a Deep Learning based model which learns customer similarity directly from the sequence to sequence similarity as well as item to

As conventional metric learning methods for feature embedding is known to lacking in capturing semantic similarity among the data under study, we have trained

A neural network interoperability format converter (NNEF parser) performs conversion into codes that can recognize inference engines or other learning engines to input a