class_docstr: Transformer-based model on PyTorch for syntax parsing. It predicts probabilities of heads and
     dependency ids for text tokens. 
  
  Args:
      pretrained_bert: pretrained Bert checkpoint path or key title (e.g. "bert-base-uncased")
      n_deps: number of syntax dependencies
      encoder_layer_ids: list of indexes of encoder layers which will be used for further predicting of heads and
          dependencies with biaffine layer
      state_size: size of dense layers which follow after transformer encoder
      attention_probs_keep_prob: keep_prob for Bert self-attention layers
      hidden_keep_prob: keep_prob for Bert hidden layers
      bert_config_file: path to Bert configuration file, or None, if `pretrained_bert` is a string name
class_docstr_tok: ["Transformer-based","model","on","PyTorch","for","syntax","parsing",".","It","predicts","probabilities","of","heads","and","dependency","ids","for","text","tokens",".","Args",":","pretrained_bert",":","pretrained","Bert","checkpoint","path","or","key","title","(","e.g",".","``","bert-base-uncased","''",")","n_deps",":","number","of","syntax","dependencies","encoder_layer_ids",":","list","of","indexes","of","encoder","layers","which","will","be","used","for","further","predicting","of","heads","and","dependencies","with","biaffine","layer","state_size",":","size","of","dense","layers","which","follow","after","transformer","encoder","attention_probs_keep_prob",":","keep_prob","for","Bert","self-attention","layers","hidden_keep_prob",":","keep_prob","for","Bert","hidden","layers","bert_config_file",":","path","to","Bert","configuration","file",",","or","None",",","if","`","pretrained_bert","`","is","a","string","name"]
code: def __init__(
      self,
      pretrained_bert: str,
      n_deps: int,
      encoder_layer_ids: List[int] = (-1,),
      state_size: int = 256,
      attention_probs_keep_prob: Optional[float] = None,
      hidden_keep_prob: Optional[float] = None,
      bert_config_file: Optional[str] = None,
      **kwargs,
  ) -> None:
      model = SyntaxParserNetwork(
          n_deps,
          pretrained_bert,
          encoder_layer_ids,
          bert_config_file,
          attention_probs_keep_prob,
          hidden_keep_prob,
          state_size,
      )
      super().__init__(model, **kwargs)
  
imports: import math
  from logging import getLogger
  from pathlib import Path
  from typing import List, Dict, Union, Optional, Tuple
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from transformers import AutoConfig, AutoModel
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.errors import ConfigError
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.torch_model import TorchModel
  from deeppavlov.models.torch_bert.torch_transformers_sequence_tagger import token_from_subtoken
label_desc: Use image node_id 1 to create a new TorchTransformersSyntaxParser object from inherited base classes: TorchModel with example: obj = TorchTransformersSyntaxParser(pretrained_bert, n_deps, encoder_layer_ids, state_size, attention_probs_keep_prob, hidden_keep_prob, bert_config_file)