class_docstr: Create topic model widget.
docstr: Trains topic model and assigns model to object as attribute.
  
  Args:
      text_docs: A list of text documents in string format. These documents should
          generally be pre-processed
      model_type: {'LDA', 'LSA', 'LSI', 'SVD', 'NMF'}
          Defines the type of model/algorithm which will be used.
      min_topics: Starting number of topics to optimize for if number of topics
          not provided. Default is 2
      max_topics: Maximum number of topics to optimize for if number of topics not
          provided. Default is 10
      no_below: Minimum number of documents a word must appear in to be used in
          training. Default is 10
      no_above: Maximum proportion of documents a word may appear in to be used in
          training. Default is 0.2
      tfidf: If True, model created using TF-IDF matrix. Otherwise, document-term
          matrix with wordcounts is used. Default is True.
      model_kwargs: Keyword arguments for the model, should be in agreement with
          `model_type`.
  
  Raises:
      ValueError: Invalid `model_type`.
code: def fit(
      self,
      text_docs: List[str],
      model_type: Optional[str] = None,
      min_topics: int = 2,
      max_topics: int = 10,
      no_below: int = 10,
      no_above: float = 0.2,
      tfidf: bool = True,
      model_kwargs: Optional[Dict] = None,
  ):
      """Trains topic model and assigns model to object as attribute.
  
      Args:
          text_docs: A list of text documents in string format. These documents should
              generally be pre-processed
          model_type: {'LDA', 'LSA', 'LSI', 'SVD', 'NMF'}
              Defines the type of model/algorithm which will be used.
          min_topics: Starting number of topics to optimize for if number of topics
              not provided. Default is 2
          max_topics: Maximum number of topics to optimize for if number of topics not
              provided. Default is 10
          no_below: Minimum number of documents a word must appear in to be used in
              training. Default is 10
          no_above: Maximum proportion of documents a word may appear in to be used in
              training. Default is 0.2
          tfidf: If True, model created using TF-IDF matrix. Otherwise, document-term
              matrix with wordcounts is used. Default is True.
          model_kwargs: Keyword arguments for the model, should be in agreement with
              `model_type`.
  
      Raises:
          ValueError: Invalid `model_type`.
      """
      if model_kwargs is not None:
          self._model_kwargs = model_kwargs
      if model_type is not None:
          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'"
              )
  
      if self._model_type == "LDA":
          self._model = self._compute_lda_model(
              text_docs, min_topics, max_topics, no_below, no_above
          )
      elif self._model_type == "LSA" or self._model_type == "LSI":
          self._model = self._compute_lsi_model(
              text_docs, min_topics, max_topics, no_below, no_above
          )
      elif self._model_type == "SVD":
          self._model = self._compute_lsa_svd_model(text_docs, tfidf)
      elif self._model_type == "NMF":
          self._model = self._compute_nmf_model(text_docs, tfidf)
  
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 17 for calling the TopicModelWidget obj's underlying member method code with example usage: obj.fit(text_docs, model_type, min_topics, max_topics, no_below, no_above, tfidf, model_kwargs) without return types