def process_file(self, file_name):
    """Gets a collection of `RelationInputExample`s for the train set."""
    data = self._read_json(os.path.join(file_name))

    num_classes = len(data[0]["meta_train"])
    num_examples_per_class = len(data[0]["meta_train"][0])

    tf.logging.info("Number of tests: %s, classes: %s, examples per class %s",
                    len(data), num_classes, num_examples_per_class)

    output = []
    for entry in data:
      candidate_sets = entry["meta_train"]
      query = entry["meta_test"]

      # Process the query context.
      query_example = self._json_entry_to_example(query, -1, -1)

      # Process the candidate contexts.
      output_sets = {}
      for (candidate_index, candidate_set) in enumerate(candidate_sets):
        output_candidate_set = []
        for (example_index, candidate) in enumerate(candidate_set):
          relation_input_example = self._json_entry_to_example(
              candidate, candidate_index, example_index)
          output_candidate_set.append(relation_input_example)
        output_sets[candidate_index] = output_candidate_set

      output.append(
          FewShotRelationInputExample(
              guid="", sets=output_sets, query=query_example))

    return output, num_classes, num_examples_per_class
Gets a collection of `RelationInputExample`s for the train set.
language/relation_learning/data/fewrel.py