def get_word_variational( self, Data, LP):
        # Operate on wv matrix, which is nDistinctWords x K
        #  has been preallocated for speed (so we can do += later)
        wv = LP['word_variational']         
        K = wv.shape[1]        
        # Fill in entries of wv with log likelihood terms
        wv[:] = LP['E_logsoftev_WordsData']
        # Add doc-specific log prior to doc-specific rows
        ElogPi = LP['E_logPi'][:,:K]
        for d in xrange(Data.nDoc):
            wv[Data.doc_range[d,0]:Data.doc_range[d,1], :] += ElogPi[d,:]
        # Take exp of wv in numerically stable manner (first subtract the max)
        #  in-place so no new allocations occur
        colIDs = np.argmax(wv, axis=1)
        # TODO: worry about sparsity of hard assign mat?
        R = scipy.sparse.csr_matrix(
                  (np.ones(Data.nObs), colIDs, np.arange(Data.nObs+1)),
                  shape=(Data.nObs, K), dtype=np.float64)
        LP['word_variational'] = R.toarray()
        assert np.allclose(1.0, np.sum(LP['word_variational'], axis=1))
        return LP

  ######################################################### Suff Stats
  #########################################################
Produce the final MIME message.
dataset/ETHPy150Open daeilkim/refinery/refinery/bnpy/bnpy-dev/bnpy/allocmodel/admix/HDPFullHard.py/HDPFullHard.get_word_variational--crossover with--dataset/ETHPy150Open marrow/mailer/marrow/mailer/message.py/Message.mime