class_docstr: Create topic model widget.
docstr: Topic Modeling made for easier training and understanding of topics.
  
  The exact model type, number of topics, and keyword arguments can be input
  to initialize the object. The object can then be used to train the model
  using the 'fit' function, and visualizations of the model can be displayed,
  such as an interactive visual (for LDA models only), an elbow plot displaying
  coherence values (for LDA or LSA/LSI models only), a DataFrame displaying the
  top keywords per topic, and a DataFrame displaying the top documents per topic.
  
  Args:
      model_type: {'LDA', 'LSA', 'LSI', 'SVD', 'NMF'}
          Defines the type of model/algorithm which will be used.
      num_topics: Sets the number of topics for the model. If None, will be
          optimized using coherence values (LDA or LSA/LSI) or becomes
          3 (SVD/NMF). Default is None.
      model_kwargs: Keyword arguments for the model, should be in agreement
          with `model_type`.
  
  Raises:
      ValueError: Invalid `model_type`.
code: def __init__(
      self,
      model_type: str = "LDA",
      num_topics: Optional[int] = None,
      model_kwargs: Optional[Dict] = None,
  ):
      """Topic Modeling made for easier training and understanding of topics.
  
      The exact model type, number of topics, and keyword arguments can be input
      to initialize the object. The object can then be used to train the model
      using the 'fit' function, and visualizations of the model can be displayed,
      such as an interactive visual (for LDA models only), an elbow plot displaying
      coherence values (for LDA or LSA/LSI models only), a DataFrame displaying the
      top keywords per topic, and a DataFrame displaying the top documents per topic.
  
      Args:
          model_type: {'LDA', 'LSA', 'LSI', 'SVD', 'NMF'}
              Defines the type of model/algorithm which will be used.
          num_topics: Sets the number of topics for the model. If None, will be
              optimized using coherence values (LDA or LSA/LSI) or becomes
              3 (SVD/NMF). Default is None.
          model_kwargs: Keyword arguments for the model, should be in agreement
              with `model_type`.
  
      Raises:
          ValueError: Invalid `model_type`.
      """
      self._model_type = model_type.upper()
      if self._model_type not in ["LDA", "LSA", "LSI", "SVD", "NMF"]:
          raise ValueError(
              "Model type must be one of either: 'LDA', 'LSA', 'LSI', 'SVD' or 'NMF'"
          )
      self._num_topics = num_topics
      self._model_kwargs = model_kwargs
  
imports: import warnings
  from typing import List, Optional, Dict, Tuple, TYPE_CHECKING
  import pandas
  import numpy
  from sklearn.decomposition import TruncatedSVD, NMF
  import matplotlib.pyplot
  import seaborn
  from data_describe.config._config import get_option
  from data_describe.text.text_preprocessing import create_doc_term_matrix, create_tfidf_matrix, filter_dictionary
  from data_describe.backends import _get_viz_backend
  from data_describe.compat import _compat, _requires, _in_notebook
  from data_describe._widget import BaseWidget
label_desc: Use image node_id 1 to create a new TopicModelWidget object from inherited base classes: BaseWidget with example: obj = TopicModelWidget(model_type, num_topics, model_kwargs)