code: def topic_model(
      text_docs: List[str],
      model_type: str = "LDA",
      num_topics: Optional[int] = 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,
  ):
      """Topic modeling.
  
      Unsupervised methods of identifying topics in documents.
  
      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.
          num_topics: Sets the number of topics for the model. If None, will be optimized
              using coherence values
          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`
  
      Returns:
          Topic model widget.
      """
      topicwidget = TopicModelWidget(
          model_type, num_topics, model_kwargs
      )
      topicwidget.fit(
          text_docs,
          model_type,
          min_topics,
          max_topics,
          no_below,
          no_above,
          tfidf,
          model_kwargs,
      )
      return topicwidget
  
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 for calling a global function with example usage: topic_model(text_docs, model_type, num_topics, min_topics, max_topics, no_below, no_above, tfidf, model_kwargs) and returns: topicwidget