def read_templates():
  """Loads relation-specific templates from `templates.csv`.

  Returns:
    a dict mapping relation IDs to string templates.
  """
  my_path = os.path.dirname(os.path.realpath(__file__))
  template_file = os.path.join(my_path, "templates.csv")
  logging.info("Reading templates from %s", template_file)
  reader = csv.reader(tf.io.gfile.GFile(template_file))
  headers = next(reader, None)
  data = collections.defaultdict(list)
  for row in reader:
    for h, v in zip(headers, row):
      data[h].append(v)
  templates = dict(zip(data["Wikidata ID"], data["Template"]))
  logging.info("\n".join("%s: %s" % (k, v) for k, v in templates.items()))
  return templates
Loads relation-specific templates from `templates.csv`.

  Returns:
    a dict mapping relation IDs to string templates.
  
language/templama/templama.py