Implementation of LDA (Latent Dirichlet Allocation) for classification tasks

Until now I have used LDA only for topic modelling. I would like to know which is the simplest implementation of LDA algorithm for classification tasks.

Topic classification lda nlp

Category Data Science


You can use LDA on your training data to build the topic representation of it for example:

  • (document)entry[1] Label A: (topic 1 has 4 words in document 1)T[1]=4, T[3]=7, T[4]=5..
  • entry[2] Label C: T[1]=3,T[2]=2...
  • entry[3] Label A: T[1]=2,T[2]=2,T[3]=5...
  • .
  • .
  • .
  • -

Using this you can build a simple decision tree: T[1]>1 AND T[3]>4 AND (T[2]>1 OR T[4] > 3) ---> Label A

Another approach would be to use: https://en.wikipedia.org/wiki/Dirichlet-multinomial_distribution#A_second_example:_Naive_Bayes_document_clustering

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.