Generates raw (English, other) pairs from a ParaCrawl V3.0 data file.

  Args:
    paracrawl_file: A ParaCrawl V3.0 en-.. data file.
  Yields:
    Pairs of (sentence_en, sentence_xx), as Unicode strings.
  Raises:
    StopIteration: If the file ends while this method is in the middle of
        creating a translation pair.

def paracrawl_v3_pairs(paracrawl_file):
  """Generates raw (English, other) pairs from a ParaCrawl V3.0 data file.

  Args:
    paracrawl_file: A ParaCrawl V3.0 en-.. data file.
  Yields:
    Pairs of (sentence_en, sentence_xx), as Unicode strings.
  Raises:
    StopIteration: If the file ends while this method is in the middle of
        creating a translation pair.
  """
  raw_sentences = _raw_sentences(paracrawl_file)
  for s_en in raw_sentences:
    try:
      s_xx = next(raw_sentences)
      if s_en and s_xx:  # Prevent empty string examples.
        yield s_en, s_xx
    except StopIteration:
      tf.logging.error(
          'Unmatched final sentence while reading in sentence pairs: [%s]',
          s_en)