def read(self, data_path: str, rel2id: Dict = None) -> Dict[str, List[Tuple]]:
        """
        This class processes the RuRED relation extraction dataset
        (http://www.dialog-21.ru/media/5093/gordeevdiplusetal-031.pdf).
        Args:
            data_path: a path to a folder with dataset files.
            rel2id: a path to a file where information about relation to relation id corresponding is stored.
        Returns:
            RuRED output dictionary in the following format:
            DocRED output dictionary in the following format:
            {"data_type":
                List[
                    Tuple(
                        List[
                            List[all tokens of the document],
                            List[
                                List[Tuple(start pos of mention 1 of ent 1, end pos of mention 1 of ent 1), ...],
                                List[Tuple(start position of entity 2, end position of entity 2), ...],
                                List[str(NER tag of entity 1), str(NER tag of entity 2)]
                            ],
                        List(int(one-hot encoded relation label))
                    )
                ]
            }
        """

        data_path = Path(data_path).resolve()

        if not rel2id:
            self.rel2id = self.add_default_rel_dict()
        else:
            self.rel2id = rel2id
        self.stat = {}
        self.ner_stat = {}

        with open(os.path.join(data_path, "train.json"), encoding='utf-8') as file:
            train_data = json.load(file)

        with open(os.path.join(data_path, "dev.json"), encoding='utf-8') as file:
            dev_data = json.load(file)

        with open(os.path.join(data_path, "test.json"), encoding='utf-8') as file:
            test_data = json.load(file)

        train_data, self.stat["train"] = self.process_rured_file(train_data, num_neg_samples="twice")
        dev_data, self.stat["dev"] = self.process_rured_file(dev_data, num_neg_samples="equal")
        test_data, self.stat["test"] = self.process_rured_file(test_data, num_neg_samples="equal")

        data = {"train": train_data, "valid": dev_data, "test": test_data}

        return data

        This class processes the RuRED relation extraction dataset
        (http://www.dialog-21.ru/media/5093/gordeevdiplusetal-031.pdf).
        Args:
            data_path: a path to a folder with dataset files.
            rel2id: a path to a file where information about relation to relation id corresponding is stored.
        Returns:
            RuRED output dictionary in the following format:
            DocRED output dictionary in the following format:
            {"data_type":
                List[
                    Tuple(
                        List[
                            List[all tokens of the document],
                            List[
                                List[Tuple(start pos of mention 1 of ent 1, end pos of mention 1 of ent 1), ...],
                                List[Tuple(start position of entity 2, end position of entity 2), ...],
                                List[str(NER tag of entity 1), str(NER tag of entity 2)]
                            ],
                        List(int(one-hot encoded relation label))
                    )
                ]
            }
        
deeppavlov/dataset_readers/rured_reader.py