class_docstr: Compute soft cosine similarity against a corpus of documents by storing the index matrix in memory.
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import common_texts
      >>> from gensim.corpora import Dictionary
      >>> from gensim.models import Word2Vec
      >>> from gensim.similarities import SoftCosineSimilarity, SparseTermSimilarityMatrix
      >>> from gensim.similarities import WordEmbeddingSimilarityIndex
      >>>
      >>> model = Word2Vec(common_texts, vector_size=20, min_count=1)  # train word-vectors
      >>> termsim_index = WordEmbeddingSimilarityIndex(model.wv)
      >>> dictionary = Dictionary(common_texts)
      >>> bow_corpus = [dictionary.doc2bow(document) for document in common_texts]
      >>> similarity_matrix = SparseTermSimilarityMatrix(termsim_index, dictionary)  # construct similarity matrix
      >>> docsim_index = SoftCosineSimilarity(bow_corpus, similarity_matrix, num_best=10)
      >>>
      >>> query = 'graph trees computer'.split()  # make a query
      >>> sims = docsim_index[dictionary.doc2bow(query)]  # calculate similarity of query to each doc from bow_corpus
  
  Check out `the Gallery <https://radimrehurek.com/gensim/auto_examples/tutorials/run_scm.html>`__
  for more examples.
class_docstr_tok: ["Compute","soft","cosine","similarity","against","a","corpus","of","documents","by","storing","the","index","matrix","in","memory",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.test.utils","import","common_texts",">",">",">","from","gensim.corpora","import","Dictionary",">",">",">","from","gensim.models","import","Word2Vec",">",">",">","from","gensim.similarities","import","SoftCosineSimilarity",",","SparseTermSimilarityMatrix",">",">",">","from","gensim.similarities","import","WordEmbeddingSimilarityIndex",">",">",">",">",">",">","model","=","Word2Vec","(","common_texts",",","vector_size=20",",","min_count=1",")","#","train","word-vectors",">",">",">","termsim_index","=","WordEmbeddingSimilarityIndex","(","model.wv",")",">",">",">","dictionary","=","Dictionary","(","common_texts",")",">",">",">","bow_corpus","=","[","dictionary.doc2bow","(","document",")","for","document","in","common_texts","]",">",">",">","similarity_matrix","=","SparseTermSimilarityMatrix","(","termsim_index",",","dictionary",")","#","construct","similarity","matrix",">",">",">","docsim_index","=","SoftCosineSimilarity","(","bow_corpus",",","similarity_matrix",",","num_best=10",")",">",">",">",">",">",">","query","=","'graph","trees","computer'.split","(",")","#","make","a","query",">",">",">","sims","=","docsim_index","[","dictionary.doc2bow","(","query",")","]","#","calculate","similarity","of","query","to","each","doc","from","bow_corpus","Check","out","`","the","Gallery","<","https",":","\/\/radimrehurek.com\/gensim\/auto_examples\/tutorials\/run_scm.html",">","`","__","for","more","examples","."]
code: def __len__(self):
      return len(self.corpus)
  
imports: import logging
  import itertools
  import os
  import heapq
  import warnings
  import numpy
  import scipy.sparse
  from gensim import interfaces, utils, matutils
label_desc: Use image node_id 2 for calling the SoftCosineSimilarity obj's underlying member method code with example usage: obj.__len__() and returns: len