code: def test_vectorization_and_topic_modeling_functionality(corpus):
      n_topics = 10
      top_n = 10
      vectorizer = Vectorizer(
          tf_type="linear",
          idf_type="smooth",
          norm=None,
          min_df=2,
          max_df=0.95,
      )
      doc_term_matrix = vectorizer.fit_transform(
          (
              (
                  term.text
                  for term in extract.terms(
                      doc, ngs=1, ents=True, ncs=True
                  )
              )
              for doc in corpus
          )
      )
      model = TopicModel("nmf", n_topics=n_topics)
      model.fit(doc_term_matrix)
      doc_topic_matrix = model.transform(doc_term_matrix)
      assert isinstance(doc_term_matrix, sp.csr_matrix)
      assert isinstance(doc_topic_matrix, np.ndarray)
      assert doc_topic_matrix.shape[1] == n_topics
      for topic_idx, top_terms in model.top_topic_terms(
          vectorizer.id_to_term, top_n=top_n
      ):
          assert isinstance(topic_idx, int)
          assert len(top_terms) == top_n
  
imports: import numpy
  import pytest
  import scipy.sparse
  from spacy.tokens import Doc, Span
  import textacy.datasets
  from textacy import Corpus
  from textacy import extract, preprocessing
  from textacy import load_spacy_lang, make_spacy_doc
  from textacy.extract import keyterms
  from textacy.text_stats import TextStats
  from textacy.tm import TopicModel
  from textacy.representations import Vectorizer
label_desc: Use image node_id 5 for calling a global function with example usage: test_vectorization_and_topic_modeling_functionality(corpus) without return types