资源算法SpectralLDA

SpectralLDA

2019-09-19 | |  54 |   0 |   0

SpectralLDA

This code implements a Spectral (third order tensor decomposition) learning method for the Latent Dirichlet Allocation model in Python.

The Spectral learning method works with empirical counts of word pair or word triplet from any document in the dataset. We average the counts and put them in tensors. We then perform tensor decomposition to learn the Latent Dirichlet Allocation model. For more details, please refer to report.pdf in the repository.

Usage

Invoke spectral_lda with the doc-term count matrix. At output we'd learn alpha for the Dirichlet prior parameter, beta for the topic-word-distribution, with one topic per column.

# docs is the doc-term count matrix# alpha0 is the sum of the Dirichlet prior parameter# k is the rank aka number of topicsfrom spectral_lda import spectral_ldaalpha, beta = spectral_lda(docs, alpha0=<alpha0>, k=<k>, l1_simplex_proj=False)# alpha is the learnt Dirichlet prior# beta is the topic-word-distribution matrix# with one column per topic

By default each column in beta may not sum to one, set l1_simplex_proj=True to perform post-processing that projects beta into the l1-simplex.

References

Anandkumar, Animashree, Rong Ge, Daniel Hsu, Sham M. Kakade, and Matus Telgarsky, Tensor Decompositions for Learning Latent Variable Model

上一篇:cnn+Highway Net

下一篇:Tacotron

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...