Learn Before
Concept

N-Gram Model

The bigram model could be generalized to the N-Gram Model which approximates the probability by looking n-1 words into the past, hence P(wnw1:n1)P(wnwnN+1:n1)P(w_n|w_{1:n-1}) ≈ P(w_n|w_{n-N+1:n-1}).

The general case of n-gram probability of a word wnw_n is given by P(wnwnN+1:n1)=C(wnN+1:n1wn)C(wnN+1:n1)P(w_n|w_{n-N+1:n-1}) = \frac{C(w_{n-N+1:n-1}w_n)}{C(w_{n-N+1:n-1})}

0

0

Updated 2022-06-28

Tags

Data Science