Gibbs Sampling and Hidden Markov Models in the Event Detection Problem