Supposing there are J total queries and K total documents, we say that the nth word from the sth sentence in document d, w dsn , has a corresponding hidden variable, z dsn that specifies exactly which of these distributions is used to generate that one word.
z dsn is a vector of length 1 + J + K, where exactly one element is 1 and the rest are 0.