docstr: Generated a KeyedVectors instance with all the possible edge embeddings
  :return: Edge embeddings
docstr_tok: ["Generated","a","KeyedVectors","instance","with","all","the","possible","edge","embeddings",":","return",":","Edge","embeddings"]
code: def as_keyed_vectors(self) -> KeyedVectors:
      """
      Generated a KeyedVectors instance with all the possible edge embeddings
      :return: Edge embeddings
      """
  
      edge_generator = combinations_with_replacement(
          getattr(self.kv, self.INDEX_MAPPING_KEY), r=2
      )
  
      if not self.quiet:
          vocab_size = len(getattr(self.kv, self.INDEX_MAPPING_KEY))
          total_size = reduce(
              lambda x, y: x * y, range(1, vocab_size + 2)
          ) / (2 * reduce(lambda x, y: x * y, range(1, vocab_size)))
  
          edge_generator = tqdm(
              edge_generator,
              desc="Generating edge features",
              total=total_size,
          )
  
      # Generate features
      tokens = []
      features = []
      for edge in edge_generator:
          token = str(tuple(sorted(edge)))
          embedding = self._embed(edge)
  
          tokens.append(token)
          features.append(embedding)
  
      # Build KV instance
      edge_kv = KeyedVectors(vector_size=self.kv.vector_size)
      if pkg_resources.get_distribution("gensim").version < "4.0.0":
          edge_kv.add(entities=tokens, weights=features)
      else:
          edge_kv.add_vectors(keys=tokens, weights=features)
  
      return edge_kv
  
imports: from abc import ABC, abstractmethod
  from functools import reduce
  from itertools import combinations_with_replacement
  import numpy
  import pkg_resources
  from gensim.models import KeyedVectors
  from tqdm import tqdm
label_desc: Use image node_id 4 for calling the EdgeEmbedder obj's underlying member method code with example usage: obj.as_keyed_vectors() and returns: edge_kv