def _get_encoder_dimension(encoder):
  """Find dimensionality of encoded vectors.

  Args:
    encoder: Object implementing the encode() method which takes
      a list of strings as input and returns a list of
      numpy vectors as output.

  Returns:
    dimension: Integer size of the encoded vectors.
  """
  vector = encoder.encode(['test sentence'])
  dimension = vector[0].shape[0]
  return dimension