Language modelling

Description of this Post
Author
Published

November 2, 2023

Language modelling

Description of this Post
Author
Published

November 2, 2023

1 Example of Categorical Distribution

  • Vocabulary:
    V=3, {dog, cat,bird}

  • Num Observations:
    N=9

  • Categories:
    C=3, {negative, neutral, positive}

  • Dataset:
    D={(class1, word1)…}

1.1 Formula for parameter estimation



Here the denominator means to count all pairs that have the same class

  • Tabular Representation:
\[ W|C=c \, \textasciitilde \, \text{ Categorical}(\theta_{1:V}^{(c)}) \]

  • The dataset:
  • Maximum Likelihood Estimates:

2 Smoothing


For instance if I have to compute the prob for \(\theta_{bird}^{neg}=\frac{0}{3}\) then because I will have a zero probability then I can use only the count plus some constant (smoothing)so that the probability estimate does not become \(0\)

For instance:

Here 0.1 is the smoothing constant

So if not smoothing then use probs, if use smoothing the we use the counts

Slide 1

Slide 2

Slide 3

Slide 4

Slide 5

Slide 6

Slide 7

Slide 8

Slide 9

Slide 10

Slide 11

Slide 12

Slide 13

Slide 14

Slide 15

Slide 16

Slide 17

Slide 18

Slide 19

Slide 20

Slide 21

Slide 22

Slide 23

Slide 24

Slide 25

Slide 26

Slide 27

Slide 28

Slide 29

Slide 30

Slide 31

Slide 32

Slide 33

Slide 34

Slide 35

Slide 36

Slide 37

Slide 38

Slide 39

Slide 40

Slide 41

Slide 42

Slide 43

Slide 44

Slide 45

Slide 46

Slide 47

Slide 48

Slide 49

Slide 50

Slide 51

Slide 52

Slide 53

Slide 54

Slide 55

Slide 56

Slide 57

Slide 58

Slide 59

Slide 60

Slide 61

Slide 62

Slide 63

Slide 64

Slide 65

Slide 66

Slide 67

Slide 68

Slide 69

Slide 70

Slide 71

Slide 72

Slide 73

Slide 74

Slide 75

Slide 76