docs: def _string_to_int(x, vocab):
    """Given a vocabulary and a string tensor `x`, maps `x` into an int tensor.
    Args:
      x: A `Column` representing a string value.
      vocab: list of strings.
  
    Returns:
      A `Column` where each string value is mapped to an integer representing
      its index in the vocab. Out of vocab values are mapped to len(vocab).
    """
  
    def _map_to_int(x):
      """Maps string tensor into indexes using vocab.
  
      Args:
        x : a Tensor/SparseTensor of string.
      Returns:
        a Tensor/SparseTensor of indexes (int) of the same shape as x.
      """
      table = lookup.index_table_from_tensor(
          vocab,
          default_value=len(vocab))
      return table.lookup(x)
  
    return _map_to_int(x)