def __init__(
            self,
            n_classes: int,
            num_ner_tags: int,
            pretrained_bert: str = None,
            return_probas: bool = False,
            threshold: Optional[float] = None,
            **kwargs
    ) -> None:
        """
        Transformer-based model on PyTorch for relation extraction. It predicts a relation hold between entities in a
        text sample (one or several sentences).
        Args:
            n_classes: number of output classes
            num_ner_tags: number of NER tags
            pretrained_bert: key title of pretrained Bert model (e.g. "bert-base-uncased")
            return_probas: set this to `True` if you need the probabilities instead of raw answers
            threshold: manually set value for defining the positively predicted classes (instead of adaptive one)
        """
        self.n_classes = n_classes
        self.return_probas = return_probas

        if self.n_classes == 0:
            raise ConfigError("Please provide a valid number of classes.")

        model = BertWithAdaThresholdLocContextPooling(
            n_classes=self.n_classes,
            pretrained_bert=pretrained_bert,
            bert_tokenizer_config_file=pretrained_bert,
            num_ner_tags=num_ner_tags,
            threshold=threshold,
        )

        super().__init__(model, **kwargs)

        Transformer-based model on PyTorch for relation extraction. It predicts a relation hold between entities in a
        text sample (one or several sentences).
        Args:
            n_classes: number of output classes
            num_ner_tags: number of NER tags
            pretrained_bert: key title of pretrained Bert model (e.g. "bert-base-uncased")
            return_probas: set this to `True` if you need the probabilities instead of raw answers
            threshold: manually set value for defining the positively predicted classes (instead of adaptive one)
        
deeppavlov/models/relation_extraction/relation_extraction_bert.py