MCPcopy Create free account
hub / github.com/google-research/language / rc_example

Function rc_example

language/capwap/preprocessing/coco_synthetic_qa.py:73–83  ·  view source on GitHub ↗

Builds an Example proto for an image-caption pair.

(image)

Source from the content-addressed store, hash-verified

71
72
73def rc_example(image):
74 """Builds an Example proto for an image-caption pair."""
75 features = dict(
76 unique_ids=io_utils.int64_feature(image.image_id),
77 input_ids=io_utils.int64_feature_list(image.input_ids),
78 input_mask=io_utils.int64_feature_list(image.input_mask),
79 segment_ids=io_utils.int64_feature_list(image.segment_ids),
80 start_positions=io_utils.int64_feature(0),
81 end_positions=io_utils.int64_feature(0),
82 answer_types=io_utils.int64_feature(ANSWER_TYPE))
83 return tf.train.Example(features=tf.train.Features(feature=features))
84
85
86def load_captions(captions_file, vocab):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…