def embed(self, examples, *, as_claim,
            as_evidence):  # Checker .tolist() -> Any
    """Embed a list of evidence text.

    Args:
      examples: A list of evidence text to embed.
      as_claim: Whether to embed examples as claims
      as_evidence: Whether to embed examples as evidence

    Returns:
      A list of embeddings, one for each evidence text.

    """
    stacked = {
        'claim_text': [],
        'evidence_text': [],
        'metadata': [],
        'label': [],
    }
    for text in examples:
      # Dummie value to make sure tokenizing works.
      if as_claim:
        stacked['claim_text'].append(text)
      else:
        stacked['claim_text'].append('a')
      if as_evidence:
        stacked['evidence_text'].append(text)
      else:
        stacked['evidence_text'].append('a')
      stacked['metadata'].append('')
      stacked['label'].append(tf.constant(0, dtype=tf.int64))

    dataset = tf.data.Dataset.from_tensor_slices((stacked,))
    batched_examples = self._encode_and_batch(
        dataset, filter_claims=False, filter_evidence=False)
    claim_preds = []
    ev_preds = []
    for batch in batched_examples:
      # model.predict() is broken after model load due to missing shapes, so
      # have to do our own batching/unbatching.
      inputs, _ = batch
      claim_encoding, ev_encoding = self._model(
          inputs, embed_claim=as_claim, embed_evidence=as_evidence)
      claim_preds.append(claim_encoding)
      ev_preds.append(ev_encoding)
    return np.vstack(claim_preds).tolist(), np.vstack(ev_preds).tolist()
Embed a list of evidence text.

    Args:
      examples: A list of evidence text to embed.
      as_claim: Whether to embed examples as claims
      as_evidence: Whether to embed examples as evidence

    Returns:
      A list of embeddings, one for each evidence text.

    
language/serene/training.py