\begin{figure}
\begin{alltt}
function ExpectationMaximization(supervised data, unsupervised data)
 set lastClassifier to initialClassifier
 for (epoch = 0; epoch < maxEpochs; ++epoch) {
      create classifier using factory
      train classifier on supervised data
      for (x in unsupervised data) {
          compute p(c|x) with lastClassifier
          for (c in category) 
              train classifier on c weighted by p(c|x)
      }
      evaluate corpus and model probability under classifier
      set lastClassifier to classifier
      break if converged
 }
 return lastClassifier
\end{alltt}
\caption{Pseudo code of Expectation Maximization\cite{EM}}\label{fig:pseudoCode-em}
\end{figure}
