code: def create_markov_matrix(weights_matrix):
      n_1, n_2 = weights_matrix.shape
      if n_1 != n_2:
          raise ValueError("'weights_matrix' should be square")
  
      row_sum = weights_matrix.sum(axis=1, keepdims=True)
  
      # normalize probability distribution differently if we have negative transition values
      if np.min(weights_matrix) <= 0:
          return softmax(weights_matrix, axis=1)
  
      return weights_matrix / row_sum
  
file_path: sentence-transformers/examples/applications/text-summarization/LexRank.py
imports: import numpy
  from scipy.sparse.csgraph import connected_components
  from scipy.special import softmax
  import logging
label_desc: Use image node_id 4 for calling a global function with example usage: create_markov_matrix(weights_matrix) and returns: unknown, softmax