class_docstr: Class to read the datasets in DocRED format
class_docstr_tok: ["Class","to","read","the","datasets","in","DocRED","format"]
docstr: Turn labels to one hot encodings 
docstr_tok: ["Turn","labels","to","one","hot","encodings"]
code: def label_to_one_hot(self, labels: List[int]) -> List:
      """Turn labels to one hot encodings"""
      relation = [0] * len(self.rel2id)
      for label in labels:
          relation[label] = 1
      return relation
  
imports: import itertools
  import json
  import os
  import random
  from logging import getLogger
  from pathlib import Path
  from typing import Dict, List, Tuple, Union
  import numpy
  import pandas
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.data.dataset_reader import DatasetReader
label_desc: Use image node_id 9 for calling the DocREDDatasetReader obj's underlying member method code with example usage: obj.label_to_one_hot(labels) and returns: relation