import json


def load_questions(data_dir, data_type):
  """Load questions information from directory.

  Args:
    data_dir: str, data directory.
    data_type: str, one of 'train', 'val', 'test'

  Returns:
    questions: list of dictionaries. Each dictionary contains information
    about a question, its corresponding image and answer.
  """
  filename = data_dir + '/questions/CLEVR_' + data_type + '_questions.json'
  with open(filename) as data_file:
    return json.load(data_file)['questions']