티스토리 뷰
Traditional word embedding 방식은, fixed vocabulary 가 있고 각 vocabulary 마다 학습된 word embedding 이 있는 형태다.
마치 사전처럼 각 단어마다 그 단어의 word embedding 이 있어서 원하는 단어의 index 만 알면, 그 단어의 word embedding 을 가지고 올 수 있다. 반면, 이 단어의 word embedding 은 항상 고정된 상태로 (static) 바뀌지 않는다. 문제는 동음이의어의 단어를 embedding 할 때이다.
Sentence 1: The mouse ran away, squeaking with fear.
Sentence 2: Click the left mouse button twice to highlight the program.
위와 같은 문장에서 두 개의 mouse 는 정확히 똑같은 embedding 을 사용한다. 이 한계를 극복하는 모델이 바로 contextual embedding 이다. ElMo 나 BERT, GPT 등이 이런 embedding 을 사용하는 대표적인 모델이다. contextual embedding 은 input 이 문장 전체이고, 문장 전체가 주어지면 그에 따라 다른 embedding 을 output 한다. 아무래도 Transformer 에 있는 self-attention 때문에 그렇게 되는게 아닐까 싶은데 어쨌든 이 경우, 같은 단어라 할지라도 어떤 문장에 등장하냐에 따라서 다른 embedding이 주어진다.
나는 아직 traditional word embedding 방식에 익숙해서 contextual embedding 에서 배우는 parameters 가 각 단어의 fixed embedding 이 아니라면 뭘 training 하는지 이해가 잘 안 되는데, 이 부분은 배우는 대로 다시 보강해서 적어야지~
'NLP > 이것저것' 카테고리의 다른 글
Naïve Bayes Classifier (0) | 2021.12.06 |
---|---|
Accumulated gradients (0) | 2021.08.03 |
Cross entropy loss (feat. negative log likelihood) (3) | 2019.10.21 |
Subword encoder - tensorflow (0) | 2019.09.02 |
Subclassing code example - tf.keras (0) | 2019.08.28 |
- Total
- Today
- Yesterday
- neural network
- 뉴런
- cs224n
- Contextual Embedding
- Statistical Language Model
- Elmo
- language model
- LM
- Pre-trained LM
- 벡터
- nlp
- Neural Language Model
- 언어모델
- 워터마킹
- transformer
- Attention Mechanism
- Bert
- 뉴럴넷
- weight vector
- GPTZero
- neurone
- word embedding
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |