def get_symbolic_dataset(_, n=100000, num_pairs=5):
  """Generates a dataset of sequences of key-value pairs and retrieval targets.

  Args:
    n: Number of examples
    num_pairs: Number of pairs in each sequence

  Returns:
    A tf.data.Dataset created from a dict with property "seqs,"
    containing the sequences of randomly generated key-value pairs, and
    "targets," containing the ground-truth value to retrieve for the query key.
  """

  seqs = []
  targets = []

  for _ in range(n):
    _, seq_encoded, _, target_encoded, _ = generate_symbolic_data(num_pairs)
    seqs.append(seq_encoded)
    targets.append(target_encoded)

  return tf.data.Dataset.from_tensor_slices({
      "seqs": np.array(seqs, dtype=np.int32),
      "targets": np.array(targets, dtype=np.int32)
  })
Generates a dataset of sequences of key-value pairs and retrieval targets.

  Args:
    n: Number of examples
    num_pairs: Number of pairs in each sequence

  Returns:
    A tf.data.Dataset created from a dict with property "seqs,"
    containing the sequences of randomly generated key-value pairs, and
    "targets," containing the ground-truth value to retrieve for the query key.
  
language/labs/memory/synthetic_dataset.py