728x90

nlp 33

Document Classification (CNN)

document classification 관련 예시 코드는 여기를 확인해주세요. [2014] yoon-kim Input : n by k matrix representation of sentence - n : the number of words in a sentence (parameter) ▷ 짧은 문장은 zero padding을 주고 긴 문장은 trimmed - k : word embedding dimensions ▷ pre-trained word embedding vectors를 사용 ▷ vectors는 static (training 과정에서 update를 하지 않는다) or non-static (fine-tuning) - multi-channel input 가능하다. → 하나의 텐서 형태가 된다. ..

Document Classification (vector space model)

document classification 관련 예시 코드는 여기를 확인해주세요. Vector space model - A single document is transformed into a single vector : 각 문서(doc)에서 단어에 대한 p차원(본 그림에서는 5차원)인 vector로 표현하는 것이다. 여기서 자주 사용되는 DTM, Topic Models, Doc2Vec 등이 있습니다. Matrix-based Model - A document is represented as a NxP matrix ▷ N : single doc에서 단어들의 최대 수 (e.g. 512 of BERT) ▷ P : word embedding dimension (e.g. 128) : 위 그림에서 5차원의 embed..

[2019] T5 : text to text transformer

[2019] Exploring Transfer Learning with T5: the Text-To-Text Transfer Transformer T5 : 여러 task가 존재할 때 이 task 자체를 text로 변환하고 input값과 함께 넣어주면 output값 또한 text로 뽑아낸다고 설명합니다. main idea ① text to text e.g.) - grammar check dataset (CoLA) original input : sentence : "I am a great man." original target : 1 processed input : CoLA sentence : "I am a great man." processed target : acceptable - Sentiment da..

Lecture Review/DSBA 2022.03.23

[2019] BART

[2020] BART : Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension BART - seq2 seq model을 pretrain 시키는 denoising autoencoder입니다. - bidirectional 하게 autoregressive transformer를 진행하였다는 점입니다. - 위의 그림과 같이 encoder에서는 noise input을 주고 decorder에서는 따로 하지 않았습니다. Noise 방법 다음처럼 ABC. DE. 의 두 sentence가 있다고 가정하여보겠습니다. ① token masking - 임의의 token을 [mask]로 교..

Lecture Review/DSBA 2022.03.23

[2019] RoBERTa : A Robustly Optimized BERT Pretraining Approach

[2019] RoBERTa : A Robustly Optimized BERT Pretraining Approach Main Idea : BERT는 아직 Underfitted model라는 것을 발견하여 이에 대한 가장 최적화된 BERT 만들어 보는 것 ① model의 학습시간 증가, batch size 키우고 train data 증가시키기 : pre-train에서 데이터 양을 늘릴수록 downstream task에서 성능이 증가하였다. ② NSP를 제거하였다. ③ longer sequence를 추가하였다. (즉, train data에서도 길이가 긴 sequence를 학습을 시켜보았다.) ④ masking pattern을 dynamic 하게 주었다. : BERT는 pre-train 전에 masking을 진..

Lecture Review/DSBA 2022.03.23

[2019] XLNet : Generalized Autogressive Pretrainig for Language

[AE와 AR] auto encoding - word sequence가 주어지면 x2를 mask 한 corrupted sequence가 주어질 것이고 이 mask 된 자리를 예측하는 것이 목적 - likelihood는 최대화하는 값을 구하는 것이다. ▶ 문제점 : [mask] token이 독립적으로 예측되기 때문에 token 사이의 dependency를 학습할 수가 없다. fine-tuning 과정에서 [mask] token이 등장하지 않기 때문에 pre-training과 fine-tuning 사이에 discrepancy 발생하게 된다. auto regressive - word sequence가 주어지고 x1, x2, x3가 있을 때 x4의 값을 예측하는 확률이 최대가 되는 값을 구하는 것이다. ▶ 문제..

Lecture Review/DSBA 2022.03.23

[2018-2019] GPT + GPT-2

[2018] GPT : Generative Pre-Training of a Language Model Motivation : unlabled text corpora가 많으니 generative pre-training language model을 통해 embedding vector를 찾아낸 후, 우리가 튜닝하고자 하는 task에 대해 (label 존재) fine-tuning 하면 더 도움이 될 것이다. GPT에서 제시하는 문제 - unlabeled text로부터 단어 level 이상으로 leveraging하는 것은 너무 challenging 하다. ▷ 어떠한 optimization objectives가 효과적인지 모른다. - target task에 대해 most effective way to transfe..

Lecture Review/DSBA 2022.03.21

[2018] BERT

관련 예시 코드는 여기를 확인해주세요. [2018] BERT : Bidirectional Encoder Representations from Transformer BERT - bidirectional encoder representation을 학습한다. ▷ Masekd language model (MLM) : 임의의 순서에 해당하는 (순차적으로 forward/backward를 사용하는 것이 아니라) 위치를 making 하여 이들을 예측하는 model을 만드는 것이다. ELMo 같은 경우, forward와 backward model을 따로 학습한 후, 해당 representation을 결합하였고, GPT의 경우, transformer의 decoder부분 (보고자 하는 단어의 후반 부분)을 모두 maskin..

Lecture Review/DSBA 2022.03.20

[2018] ELMo : Embedding from Language Model

[2018] ELMo : Embedding from Language Model Pre-trained word representations - NLP관련 downstream task (QA, classification..)가 많은 neural language understanding model의 key component High quality representations should ideally model - 단어의 복잡성을 모델링할 수 있다. (e.g., syntax and semantics) - 언어학적인 contexts 상에 서로 다르게 사용될 때 해당하는 사용법을 사용해야 합니다. (i.e., to model polysemy) ※ ploysemy의 예시를 들어보자면 눈(eye) 와 눈(snow) ..

Lecture Review/DSBA 2022.03.18

[2017] Transformer : Attention Is All You Need

여기서 사용된 자료들 또한 Alammar에 도움을 받았습니다. NLP 공부를 해본 사람이라면 꼭 한 번 이상 들었을 transformer에 대해 이야기하고자 합니다. 중요한 내용이니만큼 그림첨부가 많아 내용이 길어졌습니다. transformer의 시기 순으로 보게 될 때, Jan 16, 2013 Word2Vec Jan 2, 2014 GloVe July 15, 2016 FastText June 12, 2017 Transformer : Attention is All you need Feb 15, 2018 ELMO Oct 11, 2018 BERT [2017] Transformer - attention을 사용하는 model이면서 학습과 paralleize가 쉬운, speed를 높이고자 하는 model입니다. -..

Lecture Review/DSBA 2022.03.17
728x90
반응형