class_docstr: Class to read the datasets in DocRED format
class_docstr_tok: ["Class","to","read","the","datasets","in","DocRED","format"]
docstr: Turn the annotated documents but without any positive relation label to the negative samples in a format of
      the DocRED reader output.
  
  Args:
      ent_id2ent: a dictionary {entity id: [entity mentions' positions]}
      ent_id2ent_tag: a dictionary {entity id: entity NER tag}
      doc: list of all tokens of the document
  Returns:
      a tuple with list of all doc tokens, entity information (positions & NER tags) and relation (=neg_label).
docstr_tok: ["Turn","the","annotated","documents","but","without","any","positive","relation","label","to","the","negative","samples","in","a","format","of","the","DocRED","reader","output",".","Args",":","ent_id2ent",":","a","dictionary","{","entity","id",":","[","entity","mentions","'","positions","]","}","ent_id2ent_tag",":","a","dictionary","{","entity","id",":","entity","NER","tag","}","doc",":","list","of","all","tokens","of","the","document","Returns",":","a","tuple","with","list","of","all","doc","tokens",",","entity","information","(","positions","&","NER","tags",")","and","relation","(","=neg_label",")","."]
code: def construct_neg_samples(
      self, ent_id2ent: Dict, ent_id2ent_tag: Dict, doc: List
  ) -> List[Tuple[Tuple[List, List], List]]:
      """
      Turn the annotated documents but without any positive relation label to the negative samples in a format of
          the DocRED reader output.
  
      Args:
          ent_id2ent: a dictionary {entity id: [entity mentions' positions]}
          ent_id2ent_tag: a dictionary {entity id: entity NER tag}
          doc: list of all tokens of the document
      Returns:
          a tuple with list of all doc tokens, entity information (positions & NER tags) and relation (=neg_label).
      """
      neg_data_samples = []
      neg_label_one_hot = self.label_to_one_hot(
          [self.rel2id[self.negative_label]]
      )
      for ent1, ent2 in itertools.permutations(ent_id2ent.keys(), 2):
          neg_data_samples.append(
              self.generate_data_sample(
                  doc,
                  ent1,
                  ent2,
                  neg_label_one_hot,
                  ent_id2ent,
                  ent_id2ent_tag,
              )
          )
  
          self.stat["NEG_REL"] += 1
      return neg_data_samples
  
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 6 for calling the DocREDDatasetReader obj's underlying member method code with example usage: obj.construct_neg_samples(ent_id2ent, ent_id2ent_tag, doc) and returns: neg_data_samples