Skip to content

[Meta Issue] LDA topic word summary and other enhancements #4748

Open
@najeeb-kazmi

Description

@najeeb-kazmi

This issue summarizes many user requests for exposing or adding functionality to Latent Dirichlet Allocation (LDA) model, as well as some nits.

P1: LDA model generates inconsistent result after model save and load

#1004

P1: Topic Word Summary

Already existing functionality not working as advertised.

The LatentDirichletAllocation transform provides a popular topic modeling algorithm. It learns a model to categorize a document into n topics, and outputs an n-dimensional topic vector for each document, with scores for the document belonging to each topic.

Topic1  Topic2  Topic3
0.6364  0.2727  0.0909
0.5455  0.1818  0.2727

There are two use cases for this:

  1. Use the topic vector as a featurizer for a trainer.
  2. Predict which topic a document belongs to directly from the LDA model, for example "Cat related", "Dog related", "Tech news", etc.

(1) works fine as is, but (2) has usability issues related to interpretibility of the learned topics. The topic vector doesn't actually name the topics so it is not possible to tell what a topic actually is.

LDA has a parameter numberOfSummaryTermsPerTopic, which in theory is supposed to provide a list of most important terms for each topic. These terms would identify what a topic learned by the model actually is. However, there is no way to get this summary from the model currently, as the model parameters are not exposed, and is therefore misleading the user into thinking that this is possible.

It used to be accessible in the old PigSty API (#1411) but that has since been removed. It was also present in TLC as a text file in the model.zip, which wasn't a particularly user friendly way anyway #4322 (comment). This should be made accessible to the user by extracting the parameters from LdaState #1411 (comment).

Main issue containing the discussion: #4322
Duplicate issues with the same ask: #1411 #2197 #3092 #4328 #4735

P2: Export Full Model

New feature request: #3092

This ask is to expose more model parameters than just topic word summary.

P2: Seeded LDA

New feature request: #4143

Seed each topic with a list of words, which will make the topic words converge in that direction. May not be present in LightLDA, which ML.NET wraps.

P3: Nits

LDA always prints to console: #3192

Thank you to our users who have brought these to our attention:
@hobbsa @IvanAntipov @MagicMaxxx @nukeandserve @PaulDMendoza

cc: @harishsk @justinormont @yaeldekel @antoniovs1029 @gvashishtha

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIIssues pertaining the friendly APIP2Priority of the issue for triage purpose: Needs to be fixed at some point.enhancementNew feature or requestusabilitySmoothing user interaction or experience

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions