docstr: Creates matrix of shape |unique words|×|sentences| where cells
  contains number of occurrences of words (rows) in sentences (cols).
docstr_tok: ["Creates","matrix","of","shape","|unique","words|\u00d7|sentences|","where","cells","contains","number","of","occurrences","of","words","(","rows",")","in","sentences","(","cols",")","."]
code: def _create_matrix(self, document, dictionary):
      """
      Creates matrix of shape |unique words|×|sentences| where cells
      contains number of occurrences of words (rows) in sentences (cols).
      """
      sentences = document.sentences
  
      words_count = len(dictionary)
      sentences_count = len(sentences)
      if words_count < sentences_count:
          message = (
              "Number of words (%d) is lower than number of sentences (%d). "
              "LSA algorithm may not work properly."
          )
          warn(message % (words_count, sentences_count))
  
      # create matrix |unique words|×|sentences| filled with zeroes
      matrix = numpy.zeros((words_count, sentences_count))
      for col, sentence in enumerate(sentences):
          for word in map(self.stem_word, sentence.words):
              # only valid words is counted (not stop-words, ...)
              if word in dictionary:
                  row = dictionary[word]
                  matrix[row, col] += 1
  
      return matrix
  
file_path: sumy/sumy/summarizers/lsa.py
imports: from __future__ import absolute_import
  from __future__ import division, print_function, unicode_literals
  import math
  from warnings import warn
  from ._summarizer import AbstractSummarizer
label_desc: Use image node_id 6 for calling the LsaSummarizer obj's underlying member method code with example usage: obj._create_matrix(document, dictionary) and returns: matrix