How do we represent the meaning of a word?

1. WordNet

a thesaurus containing lists of synonym sets and hypernyms.

시소러스는 동의어, 반의어 사전이다.

 

Limitation

- Great as a resource but missing nuance (자료로서는 훌륭하나 뉘앙스를 반영하지 못한다.)

- Missing new meanings of words (단어의 새로운 의미를 반영하지 못한다.)

- Subjective (주관적이다.)

- Requires human labor to create and adapt (만들어내고 적용하기위해 인간의 노동이 필요하다.)

- Can't compute accurate word similarity (정확한 단어 유사도를 계산할 수 없다.)

 

2. One-hot Vector

In traditional NLP, we regard words as discrete symbols (전통적인 자연어처리에서, 우리는 단어들을 이산기호로 여긴다.)

- one neuron represents one concepts (하나의 뉴런은 하나의 개념을 나타낸다.)

Words can be represented by one-hot vectors.

- motel = [0 0 0 0 0 0 0 0 0 0 1 0 0 0 0]

- hotel = [0 0 0 0 0 0 0 1 0 0 0 0 0 0 0]

-> These two vectors are orthogonal - there is no natural notion of similarity for one-hot vectors.

(이 두 벡터는 직교한다. - 즉, one-hot vector에는 자연적인 유사도의 개념이 없다.)

 

Vector dimension = number of words in vocabulary (벡터의 차원은 어휘사전에 있는 단어의 개수이다.)

 

Solution

- learn to encode similarity in the vectors themselves. (벡터들만을 가지고 유사도를 인코딩하는 법을 알아내자.)

 

3. Distribution Semantics

A word's meaning is given by the words that frequently appear close-by (한 단어의 의미는 주변에 자주 등장하는 단어들에 의해 주어진다.)

-> One of the most successful ideas of modern statistical NLP! (현대 통계 자연어처리의 가장 성공적인 아이디어 중의 하나이다.)

 

When a word w appears in a text, its context is the set of words that appear nearby (within a fixed-size window).

(단어 w가 글에 등장할 때, 그것의 맥락은 근처에 등장하는 단어들의 집합이다. (고정된 크기의 window에서))

 

Use the many context of w to build up a representation of w. (단어 w의 표상을 쌓기위해 w의 다양한 맥락을 사용해라.)

We will build a dense vector for each word, chosen so that it is similar to vectors of words that appear in similar contexts. (우리는 선택된 각각의 단어에 대해 비슷한 맥락에서 나타난 단어들의 벡터와 비숫하도록 밀집 벡터를 만들 것입니다.)

 

Note: word vectors are sometimes called word embeddings or word representations. They are a distributed representation. (word vector는 때때로 word embedding이나 word representation이라고 불리기도 합니다. 그것들은 분산된 표현방식입니다.)

 

Word2Vec

a framework for learning word vectors (word vector를 배우기위한 프레임워크이다.)

 

Idea:

- We have a large corpus of text. (글의 거대한 말뭉치가 있다.)

- Every word in a fixed vocabulary is represented by a vector. (정해진 어휘 사전내에서 모든 단어는 벡터로 나타내진다.)

- Go through each position t in the text, which has a center word c and context ("outside") words o. (중심 단어 c와 맥락 단어 o를 가지고 있는 글 내의 각각의 위치 t를 모두 통과한다.

- Use the similarity of the word vectors for c and o to calculate the probability of o given c (or vice versa) (c에 대한 o의 조건부 확률을 계산하기위해 c와 o의 word vector의 유사도를 사용한다.)

- Keep adjusting the word vectors to maximize this probability. (이 확률을 극대화하기 위해 word vector들을 계속해서 조정한다.)

 

Example windows and process for computing $P(w_{t+j}|w_{t})$

 

Objective function (목적 함수)

- For each position t = 1 , ... , T, predict context words within a window of fixed size m, given center word $w_{j}$. (각각의 위치 t = 1, ... , T에 대해 주어진 중심 단어 $w_{j}$에 대한 정해진 m 크기의 윈도우 내에서 맥락 단어들을 예측한다.)

 

The objective function $J(\theta)$ is the (average) negative log likelihood. (목적 함수 $J(\theta)$는 (평균적인) 음 로그 확률이다.)

Minimizing objective finction <=> Maximizing predictive accuracy

 

Then how to calculate $P(w_{t+j}|w_{t};\theta)$?

- We will use two vectors per word w

 - $v_w$ when w is a center word

 - $u_w$ when w is a context word

 

-> Then for a center word c and a context word o

1. Dot product compares similarity of o and c. $u^Tv = u\cdot v = \sum_{i=1}^{n} u_i v_i$ Larger dot product = Larger probability

2. Exponentiation makes anything positive

3. Normalize over entire vocabulary to give probability distribution

 

This is an example of the softmax function $\mathbb{R}^n \rightarrow (0,1)^n$

 

The sofrmax function maps arbitrary values $x_i$ to a probability distribution $p_i$

- "max" because amplifies probability of largest $x_i$

- "soft" because still assigns some probability to smaller $s_i$

- Frequently used in Deep Learning

+ Recent posts