title: combine two lists to PCollection
body: <p>I'm using Apache Beam. When writing to tfRecord I need to include the ID of the item along with its text and embedding.
  The tutorial works with just one list of text but I also have a list of the IDs to match the list of text so I was wondering how I could pass the ID to the following function:</p>
  <pre><code>  def to_tf_example(entries):
    examples = []
  
    text_list, embedding_list = entries
    for i in range(len(text_list)):
      text = text_list[i]
      embedding = embedding_list[i]
  
      features = {
          # need to pass in ID here like so:
          'id': tf.train.Feature(
              bytes_list=tf.train.BytesList(value=[ids.encode('utf-8')])),
          'text': tf.train.Feature(
              bytes_list=tf.train.BytesList(value=[text.encode('utf-8')])),
          'embedding': tf.train.Feature(
              float_list=tf.train.FloatList(value=embedding.tolist()))
      }
    
      example = tf.train.Example(
          features=tf.train.Features(
              feature=features)).SerializeToString(deterministic=True)
    
      examples.append(example)
    
    return examples
  </code></pre>
  <p>My first thought was just to include the ids in the text column of my database and then extract them via slicing or regex or something but was wondering if there was a better way, I assume converting to a PCollection but don't know where to start. Here is the pipeline:</p>
  <pre><code>    with beam.Pipeline(args.runner, options=options) as pipeline:
          query_data = pipeline | 'Read data from BigQuery' &gt;&gt; 
          beam.io.Read(beam.io.BigQuerySource(project='my-project', query=get_data(args.limit), use_standard_sql=True))
          # list of texts
          text = query_data | 'get list of text' &gt;&gt; beam.Map(lambda x: x['text'])
          # list of ids
          ids = query_data | 'get list of ids' &gt;&gt; beam.Map(lambda x: x['id'])
      
          ( text
              | 'Batch elements' &gt;&gt; util.BatchElements(
              min_batch_size=args.batch_size, max_batch_size=args.batch_size)
              | 'Generate embeddings' &gt;&gt; beam.Map(
              generate_embeddings, args.module_url, args.random_projection_matrix)
              | 'Encode to tf example' &gt;&gt; beam.FlatMap(to_tf_example)
              | 'Write to TFRecords files' &gt;&gt; beam.io.WriteToTFRecord(
              file_path_prefix='{0}'.format(args.output_dir),
              file_name_suffix='.tfrecords')
          )
  
          query_data | 'Convert to entity and write to datastore' &gt;&gt; beam.Map(
                  lambda input_features: create_entity(
                      input_features, args.kind))
  </code></pre>