Docsity

Vector Semantics, Lecture notes of Vector Analysis

Partial preview of the text

Download Vector Semantics and more Lecture notes Vector Analysis in PDF only on Docsity!

Vector Semantics

Introduction

Why vector models of meaning?

computing the similarity between words

“ fast ” is similar to “ rapid ” “ tall ” is similar to “ height ” Question answering: Q: “How tall is Mt. Everest?” Candidate A: “The official height of Mount Everest is 29029 feet” 2

Word similarity for historical linguistics:

semantic change over time

4 Sagi, Kaufmann Clark 2013^ Kulkarni, Al-­‐Rfou,^ Perozzi,^ Skiena^2015 0 5 10 15 20 25 30 35 40 45 dog deer hound Semantic Broadening < Middle 1350-­‐ 1500 Modern 1500-­‐ 1710

Problems with thesaurus-­‐based meaning

  • We don’t have a thesaurus for every language
  • We can’t have a thesaurus for every year
    • For historical linguistics, we need to compare word meanings in year t to year t+
  • Thesauruses have problems with recall
    • Many words and phrases are missing
    • Thesauri work less well for verbs, adjectives

Intuition of distributional word similarity

  • Nida example: Suppose I asked you what is tesgüino? A bottle of tesgüino is on the table Everybody likes tesgüino Tesgüino makes you drunk We make tesgüino out of corn.
  • From context words humans can guess tesgüino means
    • an alcoholic beverage like beer
  • Intuition for algorithm:
    • Two words are similar if they have similar word contexts.

Four kinds of vector models

Sparse vector representations

  1. Mutual-­‐information weighted word co-­‐occurrence matrices

Dense vector representations:

  1. Singular value decomposition (and Latent Semantic Analysis)
  2. Neural-­‐network-­‐inspired models (skip-­‐grams, CBOW)
  3. Brown clusters 8

Vector Semantics

Words and co-­‐occurrence

vectors

Co-­‐occurrence Matrices

  • We represent how often a word occurs in a

document

  • Term-­‐document matrix
  • Or how often a word occurs with another
  • Term-­‐term matrix

(or word-­‐word co-­‐occurrence matrix

11 or^ word-­‐context matrix )

Similarity in term-­‐document matrices

Two documents are similar if their vectors are similar

13 As#You#Like#It Twelfth#Night Julius#Caesar Henry#V battle 1 1 8 15 soldier 2 2 12 36 fool 37 58 1 5 clown 6 117 0 0

The words in a term-­‐document matrix

  • Each word is a count vector in ℕ D

: a row below

14 As#You#Like#It Twelfth#Night Julius#Caesar Henry#V battle 1 1 8 15 soldier 2 2 12 36 fool 37 58 1 5 clown 6 117 0 0

The word-­‐word or word-­‐context matrix

  • Instead of entire documents, use smaller contexts
    • Paragraph
    • Window of ± 4 words
  • A word is now defined by a vector over counts of

context words

  • Instead of each vector being of length D
  • Each vector is now of length |V|

16 • The word-­‐word matrix is |V|x|V|

Word-­‐Word matrix

Sample contexts ± 7 words

aardvark computer data pinch result sugar … apricot 0 0 0 1 0 1 pineapple 0 0 0 1 0 1 digital 0 2 1 0 1 0 information 0 1 6 0 4 0 to the right, in which case the cell represents the number of times (in some training corpus) the column word occurs in such a ±4 word window around the row word. For example here are 7-word windows surrounding four sample words from the Brown corpus (just one example of each word): sugar, a sliced lemon, a tablespoonful of apricot preserve or jam, a pinch each of, their enjoyment. Cautiously she sampled her first pineapple and another fruit whose taste she likened well suited to programming on the digital computer. In finding the optimal R-stage policy from for the purpose of gathering data and information necessary for the study authorized in the For each word we collect the counts (from the windows around each occurrence) of the occurrences of context words. Fig. 17.2 shows a selection from the word-word co-occurrence matrix computed from the Brown corpus for these four words. aardvark ... computer data pinch result sugar ... apricot 0 ... 0 0 1 0 1 pineapple 0 ... 0 0 1 0 1 digital 0 ... 2 1 0 1 0 information 0 ... 1 6 0 4 0 … …

2 kinds of co-­‐occurrence between 2 words

  • First-­‐order co-­‐occurrence ( syntagmatic association ):
    • They are typically nearby each other.
    • wrote is a first-­‐order associate of book or poem.
  • Second-­‐order co-­‐occurrence ( paradigmatic association ):
    • They have similar neighbors.
    • wrote is a second-­‐ order associate of words like said or remarked. 19 (Schütze and Pedersen, 1993)

Vector Semantics

Positive Pointwise Mutual

Information (PPMI)