This is the purpose of the Gibbs sampling procedure.
in order to derive the update function used in the Gibbs sampler, we must provide the conditional probability of the i-th variable being assigned sense s i in layer l, given the feature value f i of the context variable and the current sense assignments of all the other variables in the data (s −i ): The probability of a single sense assignment, s i , is proportional to the product of the likelihood (of feature f i , given the rest of the data) and the prior probability of the assignment.