-
[NLP]Seq2Seq(sequence to sequence)시퀀스 투 시퀀스자연어처리NLP 2021. 4. 9. 00:19
seq2seq?
번역기에서 대표적으로 사용되는 모델이다. RNN을 기반으로 만들어진 모델이다.
seq2seq구조
seq2seq는 인코더와 디코더로 구성된다. 입력문장을 받는 RNN셀 : 인코더, 출력문장을 내보내는 RNN셀 : 디코더
인코더 : 입력 문장의 단어들을 순차적으로 입력받은 후 이를 압축해서 하나의 벡터로 만든다. 이 벡터를 context vectgor라고 한다. 인코더는 압축된 벡터를 디코더로 전송한다.
디코더 : 인코더에서 받은 context vector를 받아서 번역된 단어를 하나씩 순차적으로 출력한다.
토크나이징 된 단어들이 인코더 RNN셀의 입력이 되고 이 셀의 마지막 시점의 hidden state를 RNN셀로 넘겨주는데 이것이 컨텍스트벡터이다. 컨텍스트벡터는 디코더RNN셀의 첫번째 hidden state로 사용된다.
'자연어처리NLP' 카테고리의 다른 글
NER(Named Entity Recognition) 개체명 인식 (0) 2021.04.13 [NLP]히든 마코프 모델 HMM(Hidden Markov Model) (0) 2021.04.09 [NLP]언어 모델 LM(Language Model) (0) 2021.04.09 [NLP]트랜스포머(Transfomer):Attention Is All You Need (0) 2021.04.09