title: Get embedding vectors from Embedding Column in Tensorflow
body: <p>I want to get the numpy vectors created using the "Embedding Column" in Tensorflow.</p>
  
  <p>For example, creating a sample DF:</p>
  
  <pre><code>sample_column1 = ["Apple","Apple","Mango","Apple","Banana","Mango","Mango","Banana","Banana"]
  sample_column2 = [1,2,1,3,4,6,2,1,3]
  ds = pd.DataFrame(sample_column1,columns=["A"])
  ds["B"] = sample_column2
  ds
  </code></pre>
  
  <p>Converting the pandas DF to Tensorflow object</p>
  
  <pre><code># A utility method to create a tf.data dataset from a Pandas Dataframe
  def df_to_dataset(dataframe, shuffle=True, batch_size=32):
  
      dataframe = dataframe.copy()
      labels = dataframe.pop('B')
      ds = tf.data.Dataset.from_tensor_slices((dict(dataframe), labels))
      #print (ds)
      if shuffle:
         ds = ds.shuffle(buffer_size=len(dataframe))
      #print (ds)
      ds = ds.batch(batch_size)
      return ds
  </code></pre>
  
  <p>Creating a embedding column:</p>
  
  <pre><code>tf_ds = df_to_dataset(ds)
  # embedding cols
  col_a = feature_column.categorical_column_with_vocabulary_list(
    'A', ['Apple', 'Mango', 'Banana'])
  col_a_embedding = feature_column.embedding_column(col_a, dimension=8)
  </code></pre>
  
  <p>Is there anyway to get the embeddings  as numpy vectors from the 'col_a_embedding' object?</p>
  
  <p>Example,</p>
  
  <p>The category "Apple" will be embedded into a vector size 8:</p>
  
  <pre><code>[a1 a2 a3 a4 a5 a6 a7 a8]
  </code></pre>
  
  <p>Can we fetch that vector?</p>