SlideShare a Scribd company logo
GNMT로 알아보는 신경망
기반 기계번역
바벨피쉬 - 고병일
2016년 12월
# 순서
• 시작
• 구글번역
• RBMT / SMT
• Word Embedding
• Recurrent Neural Network
• GRU/LSTM
• Encoder-Decoder Model
• Bidirectional RNN
• Attention Model
• Google NMT
• 정리
Babel Fish Babel Pish
http://babelpish.github.io/
번역이라는게.
이러려고 번역기를 만들었
나
자괴감이 들고
구글이 그것을 만들었답니다.
구글은
• 초기에는 시스트란(SYSTRAN)의 규칙기반 기계번역 엔진을 가
지고 서비스를 시작합니다.
• 2006년 통계기반 기계번역(SMT)를 런칭합니다.
• Franz Och 입사 : 2003년
• 2007년 10월 이후엔 모든 번역 엔진을 SMT로 전환
• Moses  mkcls / giza++ 등을 개발
• Phrase based SMT에 큰기여
• 2016년 10월
• Google Neural Machine Translation 을 발표 및 서비스 런칭
• translate.google.co.kr
Franz Och
GNMT
• https://arxiv.org/pdf/1609.
08144v2.pdf
• 역쉬 이분의 이름이 있네요
• Jeffrey Dean
GNMT 현상
SMT(N)  Our core goal is to achieve this year. or This is the will to disperse and go to his
senses and our energy can make it on their mind. I think you have.
RBMT(S)  Our main goal has to have this or that mind that it can do and can accomplish to disperse our
energy if it gets back senses and advances to should achieve this year.
우리의 핵심 목표는 ~~ 그런 마음을 가지셔야 합니다.
그런 마음 가짐 : 올해 달성해야 될 것은 이것이며, 정신을 차리고 나아가면서 우리의 에너지를 분산시키는 걸 해낼수
있다는
GNMT 현상
우선 번역에 대해서
•어떤 언어로 쓰인 글을 다른 언어로 그에
상응하는 의미의 글로 전달하는 일.
•출발어 : 어떤 언어
•Source Language
•도착어 : 다른 언어
•Target Language
•기계번역
•기계를 이용하여 자연언어를 번역하는 것.
기계번역
RBMT
SMT
NMT
Rule-based Machine Translation
나는 사과를 먹었습니다
나/대명사 는/조사(SUBJ)
사과/명사 를/조사(OBJ)
먹다/동사 었/선어말어미 습니다/종결어
미
주어
목적어
서술어
주어
목적어
서술어
나/대명사 는/조사(SUBJ)
사과/명사 를/조사(OBJ)
먹다/동사 었/선어말어미 습니다/종결어
미
I
apple /single
eat/past  ate
I
an apple
ate
I ate an apple
형태소 분석 구문분석
어순 변환
대역어 치환대역어 생성
#형태소분석 #구문분석 #어순변환패턴 #대역어사전
#자연언어처리의꽃 #비용비쌈 #WSD
Statistical Machine Translation
나는 사과를 먹었습니다
I ate an apple
번역모델
Translation Model
언어모델
Language Model
재배열모델
Reordering Model
디코더
Decoder
나는  I / i / ai / …
사과를  apple / an apple / a apple / …
먹었습니다  eat / ate / drink / …
I apple eat
I eat apple
I ate apple
I ate a apple
I ate an apple
병렬 말뭉치
세라는 사과를 좋아합니다. Sera likes an apple.
나는 오렌지를 먹었습니다. I ate an orange.
…
# 2~3 million bi-sentences
학습
Training
디코딩
Decoding
#병렬말뭉치 #Moses #구현이쉽다
#누락 발생 #WSD #하지만직접하려면..
RBMT
-실제 번역의 과정을 따름
-의미모호성 문제
-용어볼륨이 매우 크고 복잡해짐  유지보수 문제
SMT
-용어번역/재배치문제를 통계적으로 해결
-어순이 다른언어에 있어서 문법 문제가 큼  한<>영
-한국어 : SOV
-영어 : SVO
-누락같은 문제가 발생
RBMT
SMT
NMT 번역(seq2seq)
• 문장 전체의 정보를 사용한 번역
RBMT/SMT
원문 이해
원문을 분석
분석
세세한 규칙으로
분할
재구성
규칙을 결함
번역문
NMT
원문
이해
원문의 이미를 이
해
재구성
의미표현에서
직접 단어를 생성
번역문
의미표현
• Google NMT에 대해서 알기전에
•NMT에 대해서 알아봅니다.
• 그전에…
• Deep Learning / Neural Network
• Word Embedding
• Recurrent Neural Network
• GRU / LSTM
• Bidirectional RNN
• Encode Decode Model
Word Embedding
• One-hot Representation
• Distributed Representation
• Word embedding
고양이 = [ 0, 0, 0, 1, 0, 0, … ]
 One-hot Representation
 Real World 라면 1000….00000 개
고양이 = [ 31.2, 10.9, 92.1, … ]
 Distritubted Representation
 500~1000개 차원으로도 표현가능
Word Embedding(cont`)
• CBOW
• “단어”란 주변 단어로 정의
• Skip-gram
• 주변 단어를 잘 설명하는 무엇이 그 “단어”를 정의
• Word2vec  https://code.google.com/archive/p/word2vec/
Recurrent Neural Network
• 시계열 데이터를 위한 신경망 구조
Recurrent Neural Network(cont`)
• 이전 정보를 적용해서 사용되는 구조
…
…
…
나는
나는
…
…
…
학교에
나는
학교에
…
…
…
간다
나는
학교에
간다
RNN : Vanishing Gradient
• RNN에서의 Vanishing Gradient 문제 극복
GRU / LSTM(cont`)
• Vanishing Gradient 문제 극복을 위한 구조
• Long Short Term Memory
• LSTM
• Gated Recurrent Unit
• GRU
• http://aikorea.org/blog/rnn-tutorial-4/
Encoder-Decoder 번역 모델
• 입력언어와 출력언어 각 RNN구조 2개를 결합한 구조
그 는 달린다
Sentence Representations
Encoder Decoder 모델 결과 (GRU이용)
Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation, HK Cho et al, 2014
On the Properties of Neural Machine Translation: Encoder-Decoder Approaches, HK Cho et al, 2014
Bidirectional Recurrent NN
• Sequence to Sequence Learning with Neural Networks
• Ilya Sutskever(google) et al. 2014
• 입력 문자열을 뒤집어서도 학습하니 긴 문장에 대해서도 성능이
올라감
• 학습
• 나는 학교에 간다 -- I go to school
• 간다 학교에 나는 -- I go to school
•  Bi-directional RNN
• Perplexity : 5.8  4.7
• BLEU : 25.9  30.6
Bidirectional RNN
Soft Attention Model
“I love coffee” -> “나는 커피를 사랑한다”
“I love coffee” -> “나는 커피를 사랑한다”
“I love coffee” -> “나는 커피를 사랑한다”
문장이 길어도 .. Attention Model
Neural Machine Translation
• RNN
• GRU/LSTM
• Encoder Decoder
• Soft Attention Model
• Bidirectional RNN
• Limitation
• Vocabulary size : OOV
• Model Size
• Training & Translation Time
Google NMT
Google NMT << NMT
• LSTM
• Encoder Decoder
• Attention Mechanism
• Bidirectional RNN
• 1st encoder layer
Google NMT <> NMT
• Deep layer : 8 layers
• Encoder
• 1 bidirectional RNN layer
• 7 unidirectional RNN layers
• Decoder
• 8 unidirectional RNN layers
• Residual networks
• Parallelization
• WPM : Word Piece Model
• Quantize / TPU
• Beam search using length-normalization
Residual Network
• Vanishing Gradient
• Deep layers
http://smerity.com/articles/2016/google_nmt_arch.html
Deep Layers
http://smerity.com/articles/2016/google_nmt_arch.html
Parallelization
http://smerity.com/articles/2016/google_nmt_arch.html
Google NMT Architecture
Segmentation Approach
• WPM
• Word Piece Model
• Sub-word unit
• Vocabulary size 제한에 유리
• 한국어/일본어 같은 아시아 언어
• 50k~60k : target language vocabulary
• Mixed Word/Character Model
• <B> , <M> , <E>
• Miki  OOV
• <B>M <M>i <M>k <E>i
Quantization
• Floating point
number
• 32bit
• Integer
• 8 bit
• Model size
• 75% 축소
• CPU Time 속도
보장
https://petewarden.com/2016/05/03/how-to-quantize-neural-networks-with-tensorflow/
TPU
• Tensor Processing Unit
https://tensorflow.blog/2016/05/19/tensor-processing-unittpu/
GNMT - Evaluation
GNMT : one more things
• https://arxiv.org/pdf/1611.04558v1.pdf
• Google”s Multilingual Neural Machine Translation System:
Enabling Zero-Shot Translation
• <2es> Hello, how are you? -> ¿Hola como estás?
• 12 languages
GNMT : one more things(cont`)
GNMT : one more things(cont`)
• 현재 이 논문에서 구현된 형태가 서비스 된게 아닌지.
GNMT : one more things(cont`)
• Mixing language 도 가능
GNMT : one more things(cont`)
자세한 사항은 ..
정리
• NMT는 기존의 기계번역방법은 심플하게 풀어버림
• << RBMT / SMT
• 구문 분석기 / 구조 변환기 / …  필요 없음
• 그런데 번역스럽지 않게 번역을 잘함
• GPU기반
• GNMT
• Practically 하게 NMT문제를 해결함
• 기존의 4 layer정도의 구조를 8 layer로의 Deep 한 구조를 갖으면서
이문제를 residual network로 해결
• GPU문제는 Quantization 문제로 CPU/TPU에서 번역 서비스 가능토록
함
• 대량의 서버 인프라
• 구글이 하면 뭔가 다른기 하네요
감사합니다.
Thang you.
ありがとうございます.
Dank.
Merci.
谢谢.
Refs.
• https://devblogs.nvidia.com/parallelforall/introduction-neural-machine-translation-gpus-part-1/
• https://devblogs.nvidia.com/parallelforall/introduction-neural-machine-translation-gpus-part-2/
• https://devblogs.nvidia.com/parallelforall/introduction-neural-machine-translation-gpus-part-3/
• http://nlp.stanford.edu/projects/nmt/Luong-Cho-Manning-NMT-ACL2016-v4.pdf
• http://kv-emptypages.blogspot.kr/2016/09/comparing-neural-mt-smt-and-rbmt.html
• http://neuralnetworksanddeeplearning.com/chap6.html
• https://blog.acolyer.org/2016/04/21/the-amazing-power-of-word-vectors/
• http://aikorea.org/blog/rnn-tutorial-1/
• http://aikorea.org/blog/rnn-tutorial-4/
• http://www.jmlr.org/papers/volume12/collobert11a/collobert11a.pdf
• http://www.slideshare.net/ToshiakiNakazawa/gnmt-66491745
• http://www.slideshare.net/ToshiakiNakazawa/attentionbased-nmt-description?next_slideshow=1
• http://www.slideshare.net/YusukeOda1/encoderdecoder-tis
• https://shuuki4.wordpress.com/2016/01/27/word2vec-%EA%B4%80%EB%A0%A8-%EC%9D%B4%EB%A1%A0-
%EC%A0%95%EB%A6%AC/
• http://aikorea.org/blog/rnn-tutorial-3/
• http://eric-yuan.me/rnn2-lstm/
• https://arxiv.org/pdf/1409.3215v3.pdf
• https://petewarden.com/2016/05/03/how-to-quantize-neural-networks-with-tensorflow/
• https://arxiv.org/pdf/1611.04558v1.pdf

More Related Content

What's hot

What's hot (20)

The Integration of Laravel with Swoole
The Integration of Laravel with SwooleThe Integration of Laravel with Swoole
The Integration of Laravel with Swoole
 
Python을 활용한 챗봇 서비스 개발 1일차
Python을 활용한 챗봇 서비스 개발 1일차Python을 활용한 챗봇 서비스 개발 1일차
Python을 활용한 챗봇 서비스 개발 1일차
 
[2D2]다국어음성합성시스템(NVOICE)개발
[2D2]다국어음성합성시스템(NVOICE)개발[2D2]다국어음성합성시스템(NVOICE)개발
[2D2]다국어음성합성시스템(NVOICE)개발
 
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
프로그래머가 알아야 하는 2진수 기반의 컴퓨터 동작 원리
 
[Paper] eXplainable ai(xai) in computer vision
[Paper] eXplainable ai(xai) in computer vision[Paper] eXplainable ai(xai) in computer vision
[Paper] eXplainable ai(xai) in computer vision
 
Deflate
DeflateDeflate
Deflate
 
90分 Scheme to C(勝手に抄訳版)
90分 Scheme to C(勝手に抄訳版)90分 Scheme to C(勝手に抄訳版)
90分 Scheme to C(勝手に抄訳版)
 
キャッシュコヒーレントに囚われない並列カウンタ達
キャッシュコヒーレントに囚われない並列カウンタ達キャッシュコヒーレントに囚われない並列カウンタ達
キャッシュコヒーレントに囚われない並列カウンタ達
 
CPythonを読もう
CPythonを読もうCPythonを読もう
CPythonを読もう
 
ウェーブレット木の世界
ウェーブレット木の世界ウェーブレット木の世界
ウェーブレット木の世界
 
[C++ Korea] C++ 메모리 모델과 atomic 타입 연산들
[C++ Korea] C++ 메모리 모델과 atomic 타입 연산들[C++ Korea] C++ 메모리 모델과 atomic 타입 연산들
[C++ Korea] C++ 메모리 모델과 atomic 타입 연산들
 
주가 정보 다루기.pdf
주가 정보 다루기.pdf주가 정보 다루기.pdf
주가 정보 다루기.pdf
 
Swoole Love PHP
Swoole Love PHPSwoole Love PHP
Swoole Love PHP
 
NLU Tech Talk with KorBERT
NLU Tech Talk with KorBERTNLU Tech Talk with KorBERT
NLU Tech Talk with KorBERT
 
Ctfのためのpython入門
Ctfのためのpython入門Ctfのためのpython入門
Ctfのためのpython入門
 
딥러닝 자연어처리 - RNN에서 BERT까지
딥러닝 자연어처리 - RNN에서 BERT까지딥러닝 자연어처리 - RNN에서 BERT까지
딥러닝 자연어처리 - RNN에서 BERT까지
 
코끼리를 냉장고에 넣는 법 - 최부호, NDC2013
코끼리를 냉장고에 넣는 법 - 최부호, NDC2013코끼리를 냉장고에 넣는 법 - 최부호, NDC2013
코끼리를 냉장고에 넣는 법 - 최부호, NDC2013
 
Re永続データ構造が分からない人のためのスライド
Re永続データ構造が分からない人のためのスライドRe永続データ構造が分からない人のためのスライド
Re永続データ構造が分からない人のためのスライド
 
つくってあそぼ ラムダ計算インタプリタ
つくってあそぼ ラムダ計算インタプリタつくってあそぼ ラムダ計算インタプリタ
つくってあそぼ ラムダ計算インタプリタ
 
Networking in Java with NIO and Netty
Networking in Java with NIO and NettyNetworking in Java with NIO and Netty
Networking in Java with NIO and Netty
 

Similar to GNMT로 알아보는 신경망 기반 기계번역

AWS CLOUD 2018-AWS의 새로운 언어, 음성, 텍스트 처리 인공지능 서비스 (남궁영환 솔루션즈 아키텍트)
AWS CLOUD 2018-AWS의 새로운 언어, 음성, 텍스트 처리 인공지능 서비스 (남궁영환 솔루션즈 아키텍트)AWS CLOUD 2018-AWS의 새로운 언어, 음성, 텍스트 처리 인공지능 서비스 (남궁영환 솔루션즈 아키텍트)
AWS CLOUD 2018-AWS의 새로운 언어, 음성, 텍스트 처리 인공지능 서비스 (남궁영환 솔루션즈 아키텍트)
Amazon Web Services Korea
 

Similar to GNMT로 알아보는 신경망 기반 기계번역 (20)

[224] backend 개발자의 neural machine translation 개발기 김상경
[224] backend 개발자의 neural machine translation 개발기 김상경[224] backend 개발자의 neural machine translation 개발기 김상경
[224] backend 개발자의 neural machine translation 개발기 김상경
 
[IT21 글로벌 컨퍼런스] 대화시스템 개발을 위한 자연어처리기술 - 서희철
[IT21 글로벌 컨퍼런스] 대화시스템 개발을 위한 자연어처리기술 - 서희철[IT21 글로벌 컨퍼런스] 대화시스템 개발을 위한 자연어처리기술 - 서희철
[IT21 글로벌 컨퍼런스] 대화시스템 개발을 위한 자연어처리기술 - 서희철
 
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례
[NUGU Conference 2018] 세션 B-1 : 음성인식 기술 및 응용 사례
 
문자 단위의 Neural Machine Translation
문자 단위의 Neural Machine Translation문자 단위의 Neural Machine Translation
문자 단위의 Neural Machine Translation
 
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
텐서플로우 설치도 했고 튜토리얼도 봤고 기초 예제도 짜봤다면 TensorFlow KR Meetup 2016
 
JMI Techtalk: 강재욱 - Toward tf.keras from tf.estimator - From TensorFlow 2.0 p...
JMI Techtalk: 강재욱 - Toward tf.keras from tf.estimator - From TensorFlow 2.0 p...JMI Techtalk: 강재욱 - Toward tf.keras from tf.estimator - From TensorFlow 2.0 p...
JMI Techtalk: 강재욱 - Toward tf.keras from tf.estimator - From TensorFlow 2.0 p...
 
100% Serverless big data scale production Deep Learning System
100% Serverless big data scale production Deep Learning System100% Serverless big data scale production Deep Learning System
100% Serverless big data scale production Deep Learning System
 
Pycon Korea 2020
Pycon Korea 2020 Pycon Korea 2020
Pycon Korea 2020
 
소프트웨어 2.0을 활용한 게임 어뷰징 검출
소프트웨어 2.0을 활용한 게임 어뷰징 검출소프트웨어 2.0을 활용한 게임 어뷰징 검출
소프트웨어 2.0을 활용한 게임 어뷰징 검출
 
Sequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural NetworksSequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural Networks
 
한글 언어 자원과 R: KoNLP 개선과 활용
한글 언어 자원과 R: KoNLP 개선과 활용한글 언어 자원과 R: KoNLP 개선과 활용
한글 언어 자원과 R: KoNLP 개선과 활용
 
딥러닝 세계에 입문하기 위반 분투
딥러닝 세계에 입문하기 위반 분투딥러닝 세계에 입문하기 위반 분투
딥러닝 세계에 입문하기 위반 분투
 
Spark machine learning & deep learning
Spark machine learning & deep learningSpark machine learning & deep learning
Spark machine learning & deep learning
 
[IGC2017] Protocol:hyperspace Diver 개발 포스트모템
[IGC2017] Protocol:hyperspace Diver 개발 포스트모템[IGC2017] Protocol:hyperspace Diver 개발 포스트모템
[IGC2017] Protocol:hyperspace Diver 개발 포스트모템
 
Node.js in Flitto
Node.js in FlittoNode.js in Flitto
Node.js in Flitto
 
메이크챗봇 자연어기초
메이크챗봇 자연어기초메이크챗봇 자연어기초
메이크챗봇 자연어기초
 
Spark streaming tutorial
Spark streaming tutorialSpark streaming tutorial
Spark streaming tutorial
 
AWS CLOUD 2018-AWS의 새로운 언어, 음성, 텍스트 처리 인공지능 서비스 (남궁영환 솔루션즈 아키텍트)
AWS CLOUD 2018-AWS의 새로운 언어, 음성, 텍스트 처리 인공지능 서비스 (남궁영환 솔루션즈 아키텍트)AWS CLOUD 2018-AWS의 새로운 언어, 음성, 텍스트 처리 인공지능 서비스 (남궁영환 솔루션즈 아키텍트)
AWS CLOUD 2018-AWS의 새로운 언어, 음성, 텍스트 처리 인공지능 서비스 (남궁영환 솔루션즈 아키텍트)
 
신입 엔지니어 취준 꿀팁
신입 엔지니어 취준 꿀팁신입 엔지니어 취준 꿀팁
신입 엔지니어 취준 꿀팁
 
NDC 2016, [슈판워] 맨땅에서 데이터 분석 시스템 만들어나가기
NDC 2016, [슈판워] 맨땅에서 데이터 분석 시스템 만들어나가기NDC 2016, [슈판워] 맨땅에서 데이터 분석 시스템 만들어나가기
NDC 2016, [슈판워] 맨땅에서 데이터 분석 시스템 만들어나가기
 

GNMT로 알아보는 신경망 기반 기계번역

  • 1. GNMT로 알아보는 신경망 기반 기계번역 바벨피쉬 - 고병일 2016년 12월
  • 2. # 순서 • 시작 • 구글번역 • RBMT / SMT • Word Embedding • Recurrent Neural Network • GRU/LSTM • Encoder-Decoder Model • Bidirectional RNN • Attention Model • Google NMT • 정리
  • 3. Babel Fish Babel Pish http://babelpish.github.io/
  • 7. 구글은 • 초기에는 시스트란(SYSTRAN)의 규칙기반 기계번역 엔진을 가 지고 서비스를 시작합니다. • 2006년 통계기반 기계번역(SMT)를 런칭합니다. • Franz Och 입사 : 2003년 • 2007년 10월 이후엔 모든 번역 엔진을 SMT로 전환 • Moses  mkcls / giza++ 등을 개발 • Phrase based SMT에 큰기여 • 2016년 10월 • Google Neural Machine Translation 을 발표 및 서비스 런칭 • translate.google.co.kr Franz Och
  • 8. GNMT • https://arxiv.org/pdf/1609. 08144v2.pdf • 역쉬 이분의 이름이 있네요 • Jeffrey Dean
  • 9. GNMT 현상 SMT(N)  Our core goal is to achieve this year. or This is the will to disperse and go to his senses and our energy can make it on their mind. I think you have. RBMT(S)  Our main goal has to have this or that mind that it can do and can accomplish to disperse our energy if it gets back senses and advances to should achieve this year. 우리의 핵심 목표는 ~~ 그런 마음을 가지셔야 합니다. 그런 마음 가짐 : 올해 달성해야 될 것은 이것이며, 정신을 차리고 나아가면서 우리의 에너지를 분산시키는 걸 해낼수 있다는
  • 11. 우선 번역에 대해서 •어떤 언어로 쓰인 글을 다른 언어로 그에 상응하는 의미의 글로 전달하는 일. •출발어 : 어떤 언어 •Source Language •도착어 : 다른 언어 •Target Language •기계번역 •기계를 이용하여 자연언어를 번역하는 것.
  • 13. Rule-based Machine Translation 나는 사과를 먹었습니다 나/대명사 는/조사(SUBJ) 사과/명사 를/조사(OBJ) 먹다/동사 었/선어말어미 습니다/종결어 미 주어 목적어 서술어 주어 목적어 서술어 나/대명사 는/조사(SUBJ) 사과/명사 를/조사(OBJ) 먹다/동사 었/선어말어미 습니다/종결어 미 I apple /single eat/past  ate I an apple ate I ate an apple 형태소 분석 구문분석 어순 변환 대역어 치환대역어 생성 #형태소분석 #구문분석 #어순변환패턴 #대역어사전 #자연언어처리의꽃 #비용비쌈 #WSD
  • 14. Statistical Machine Translation 나는 사과를 먹었습니다 I ate an apple 번역모델 Translation Model 언어모델 Language Model 재배열모델 Reordering Model 디코더 Decoder 나는  I / i / ai / … 사과를  apple / an apple / a apple / … 먹었습니다  eat / ate / drink / … I apple eat I eat apple I ate apple I ate a apple I ate an apple 병렬 말뭉치 세라는 사과를 좋아합니다. Sera likes an apple. 나는 오렌지를 먹었습니다. I ate an orange. … # 2~3 million bi-sentences 학습 Training 디코딩 Decoding #병렬말뭉치 #Moses #구현이쉽다 #누락 발생 #WSD #하지만직접하려면..
  • 15. RBMT -실제 번역의 과정을 따름 -의미모호성 문제 -용어볼륨이 매우 크고 복잡해짐  유지보수 문제 SMT -용어번역/재배치문제를 통계적으로 해결 -어순이 다른언어에 있어서 문법 문제가 큼  한<>영 -한국어 : SOV -영어 : SVO -누락같은 문제가 발생
  • 17. NMT 번역(seq2seq) • 문장 전체의 정보를 사용한 번역 RBMT/SMT 원문 이해 원문을 분석 분석 세세한 규칙으로 분할 재구성 규칙을 결함 번역문 NMT 원문 이해 원문의 이미를 이 해 재구성 의미표현에서 직접 단어를 생성 번역문 의미표현
  • 18. • Google NMT에 대해서 알기전에 •NMT에 대해서 알아봅니다. • 그전에… • Deep Learning / Neural Network • Word Embedding • Recurrent Neural Network • GRU / LSTM • Bidirectional RNN • Encode Decode Model
  • 19. Word Embedding • One-hot Representation • Distributed Representation • Word embedding 고양이 = [ 0, 0, 0, 1, 0, 0, … ]  One-hot Representation  Real World 라면 1000….00000 개 고양이 = [ 31.2, 10.9, 92.1, … ]  Distritubted Representation  500~1000개 차원으로도 표현가능
  • 20. Word Embedding(cont`) • CBOW • “단어”란 주변 단어로 정의 • Skip-gram • 주변 단어를 잘 설명하는 무엇이 그 “단어”를 정의 • Word2vec  https://code.google.com/archive/p/word2vec/
  • 21. Recurrent Neural Network • 시계열 데이터를 위한 신경망 구조
  • 22. Recurrent Neural Network(cont`) • 이전 정보를 적용해서 사용되는 구조 … … … 나는 나는 … … … 학교에 나는 학교에 … … … 간다 나는 학교에 간다
  • 23. RNN : Vanishing Gradient • RNN에서의 Vanishing Gradient 문제 극복
  • 24. GRU / LSTM(cont`) • Vanishing Gradient 문제 극복을 위한 구조 • Long Short Term Memory • LSTM • Gated Recurrent Unit • GRU • http://aikorea.org/blog/rnn-tutorial-4/
  • 25. Encoder-Decoder 번역 모델 • 입력언어와 출력언어 각 RNN구조 2개를 결합한 구조 그 는 달린다
  • 26.
  • 28. Encoder Decoder 모델 결과 (GRU이용) Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation, HK Cho et al, 2014 On the Properties of Neural Machine Translation: Encoder-Decoder Approaches, HK Cho et al, 2014
  • 29. Bidirectional Recurrent NN • Sequence to Sequence Learning with Neural Networks • Ilya Sutskever(google) et al. 2014 • 입력 문자열을 뒤집어서도 학습하니 긴 문장에 대해서도 성능이 올라감 • 학습 • 나는 학교에 간다 -- I go to school • 간다 학교에 나는 -- I go to school •  Bi-directional RNN • Perplexity : 5.8  4.7 • BLEU : 25.9  30.6
  • 31. Soft Attention Model “I love coffee” -> “나는 커피를 사랑한다” “I love coffee” -> “나는 커피를 사랑한다” “I love coffee” -> “나는 커피를 사랑한다”
  • 32. 문장이 길어도 .. Attention Model
  • 33. Neural Machine Translation • RNN • GRU/LSTM • Encoder Decoder • Soft Attention Model • Bidirectional RNN • Limitation • Vocabulary size : OOV • Model Size • Training & Translation Time
  • 34.
  • 36. Google NMT << NMT • LSTM • Encoder Decoder • Attention Mechanism • Bidirectional RNN • 1st encoder layer
  • 37. Google NMT <> NMT • Deep layer : 8 layers • Encoder • 1 bidirectional RNN layer • 7 unidirectional RNN layers • Decoder • 8 unidirectional RNN layers • Residual networks • Parallelization • WPM : Word Piece Model • Quantize / TPU • Beam search using length-normalization
  • 38. Residual Network • Vanishing Gradient • Deep layers http://smerity.com/articles/2016/google_nmt_arch.html
  • 42. Segmentation Approach • WPM • Word Piece Model • Sub-word unit • Vocabulary size 제한에 유리 • 한국어/일본어 같은 아시아 언어 • 50k~60k : target language vocabulary • Mixed Word/Character Model • <B> , <M> , <E> • Miki  OOV • <B>M <M>i <M>k <E>i
  • 43. Quantization • Floating point number • 32bit • Integer • 8 bit • Model size • 75% 축소 • CPU Time 속도 보장 https://petewarden.com/2016/05/03/how-to-quantize-neural-networks-with-tensorflow/
  • 44. TPU • Tensor Processing Unit https://tensorflow.blog/2016/05/19/tensor-processing-unittpu/
  • 46. GNMT : one more things • https://arxiv.org/pdf/1611.04558v1.pdf • Google”s Multilingual Neural Machine Translation System: Enabling Zero-Shot Translation • <2es> Hello, how are you? -> ¿Hola como estás? • 12 languages
  • 47. GNMT : one more things(cont`)
  • 48. GNMT : one more things(cont`) • 현재 이 논문에서 구현된 형태가 서비스 된게 아닌지.
  • 49. GNMT : one more things(cont`) • Mixing language 도 가능
  • 50. GNMT : one more things(cont`) 자세한 사항은 ..
  • 51. 정리 • NMT는 기존의 기계번역방법은 심플하게 풀어버림 • << RBMT / SMT • 구문 분석기 / 구조 변환기 / …  필요 없음 • 그런데 번역스럽지 않게 번역을 잘함 • GPU기반 • GNMT • Practically 하게 NMT문제를 해결함 • 기존의 4 layer정도의 구조를 8 layer로의 Deep 한 구조를 갖으면서 이문제를 residual network로 해결 • GPU문제는 Quantization 문제로 CPU/TPU에서 번역 서비스 가능토록 함 • 대량의 서버 인프라 • 구글이 하면 뭔가 다른기 하네요
  • 53. Refs. • https://devblogs.nvidia.com/parallelforall/introduction-neural-machine-translation-gpus-part-1/ • https://devblogs.nvidia.com/parallelforall/introduction-neural-machine-translation-gpus-part-2/ • https://devblogs.nvidia.com/parallelforall/introduction-neural-machine-translation-gpus-part-3/ • http://nlp.stanford.edu/projects/nmt/Luong-Cho-Manning-NMT-ACL2016-v4.pdf • http://kv-emptypages.blogspot.kr/2016/09/comparing-neural-mt-smt-and-rbmt.html • http://neuralnetworksanddeeplearning.com/chap6.html • https://blog.acolyer.org/2016/04/21/the-amazing-power-of-word-vectors/ • http://aikorea.org/blog/rnn-tutorial-1/ • http://aikorea.org/blog/rnn-tutorial-4/ • http://www.jmlr.org/papers/volume12/collobert11a/collobert11a.pdf • http://www.slideshare.net/ToshiakiNakazawa/gnmt-66491745 • http://www.slideshare.net/ToshiakiNakazawa/attentionbased-nmt-description?next_slideshow=1 • http://www.slideshare.net/YusukeOda1/encoderdecoder-tis • https://shuuki4.wordpress.com/2016/01/27/word2vec-%EA%B4%80%EB%A0%A8-%EC%9D%B4%EB%A1%A0- %EC%A0%95%EB%A6%AC/ • http://aikorea.org/blog/rnn-tutorial-3/ • http://eric-yuan.me/rnn2-lstm/ • https://arxiv.org/pdf/1409.3215v3.pdf • https://petewarden.com/2016/05/03/how-to-quantize-neural-networks-with-tensorflow/ • https://arxiv.org/pdf/1611.04558v1.pdf

Editor's Notes

  1. https://en.wikipedia.org/wiki/Google_Translate
  2. 우리의 핵심 목표는, 올해 달성해야 될 것은 이것이다 하고 정신을 차리고 나아가면 우리의 에너지를 분산시키는 걸 해낼 수 있다는 그런 마음을 가지셔야 합니다. Disperse= 분산시키다.  ”하고”
  3. GeorgeTown IBM : MT(first) RU>EN ALPAC : 7명의 과학자가 모여서 기계번역의 미래에 대한 리포트를 제출함 / 기계번역은 휴먼 번역에 비해서 더 비싸고 덜 정확하고 느릴 것이다. METEO : Canada / 기상 예보용 / FR<>EN
  4. 2-D Visualization of Sentence Representations from [Sutskever et al., 2014]. Similar sentences are close together in summary-vector space.
  5. Dramatic drop of performance w.r.t. the length of sentence with a small encoder-decoder model. 영>프
  6. Bidirectional recurrent neural networks for encoding a source sentence.
  7. RNNsearch-50 is a neural machine translation model with the attention mechanism trained on all the sentence pairs of length at most 50.
  8. RNN search-50 : length 50까지 학습 RNN search-30 : length 30까지
  9. http://smerity.com/articles/2016/google_nmt_arch.html
  10. https://petewarden.com/2016/05/03/how-to-quantize-neural-networks-with-tensorflow/