def filter_evidence_fn(
    example, y_input):
  # pylint: disable=unused-argument
  """Filter out claims/evidence that have zero length.

  Args:
    example: The encoded example
    y_input: Unused, contains the label, included for API compat
  Returns:
    True to preserve example, False to filter it out
  """
  # Bert encodes text in evidence_text_word_ids.
  # Word embedding model uses evidence_text.
  if 'evidence_text_word_ids' in example:
    evidence_length = len(example['evidence_text_word_ids'])
  else:
    evidence_length = len(example['evidence_text'])

  # Explicit length check required.
  # Implicit length check causes TensorFlow to fail during tracing.
  if evidence_length != 0:
    return True
  else:
    return False
Filter out claims/evidence that have zero length.

  Args:
    example: The encoded example
    y_input: Unused, contains the label, included for API compat
  Returns:
    True to preserve example, False to filter it out
  
language/serene/preprocessing.py