class_docstr: Class for building of sparql query template using syntax parser
class_docstr_tok: ["Class","for","building","of","sparql","query","template","using","syntax","parser"]
docstr: Args:
      sparql_queries_filename: file with sparql query templates
      syntax_parser: component for syntactic parsing of the input question
      kb_prefixes: prefixes for entities, relations and types in the knowledge base
      adj_to_noun: component deeppavlov.models.kbqa.tree_to_sparql:RuAdjToNoun
      **kwargs:
code: def __init__(
      self,
      sparql_queries_filename: str,
      syntax_parser: Component,
      kb_prefixes: Dict[str, str],
      adj_to_noun: RuAdjToNoun = None,
      **kwargs,
  ):
      """
  
      Args:
          sparql_queries_filename: file with sparql query templates
          syntax_parser: component for syntactic parsing of the input question
          kb_prefixes: prefixes for entities, relations and types in the knowledge base
          adj_to_noun: component deeppavlov.models.kbqa.tree_to_sparql:RuAdjToNoun
          **kwargs:
      """
      self.q_pronouns = {
          "какой",
          "какая",
          "какое",
          "каком",
          "каким",
          "какую",
          "кто",
          "что",
          "как",
          "когда",
          "где",
          "чем",
          "сколько",
      }
      self.how_many = "сколько"
      self.change_root_tokens = {"каким был", "какой была"}
      self.first_tokens = {"первый", "первая", "первое"}
      self.last_tokens = {"последний"}
      self.begin_tokens = {"начинать", "начать"}
      self.end_tokens = {"завершить", "завершать", "закончить"}
      self.ranking_tokens = {"самый"}
      self.date_tokens = {"год", "месяц"}
      self.nlp = spacy.load("ru_core_news_sm")
      self.re_tokenizer = re.compile(r"[\w']+|[^\w ]")
      self.sparql_queries_filename = expand_path(
          sparql_queries_filename
      )
      template_queries = read_json(self.sparql_queries_filename)
      self.template_queries = preprocess_template_queries(
          template_queries, kb_prefixes
      )
      self.syntax_parser = syntax_parser
      self.adj_to_noun = adj_to_noun
  
imports: import copy
  import re
  from collections import defaultdict
  from io import StringIO
  from logging import getLogger
  from typing import Any, List, Tuple, Dict, Union
  import spacy
  from navec import Navec
  from razdel import tokenize
  from slovnet import Syntax
  from udapi.block.read.conllu import Conllu
  from udapi.core.node import Node
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.file import read_json
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
  from deeppavlov.core.models.serializable import Serializable
  from deeppavlov.models.kbqa.ru_adj_to_noun import RuAdjToNoun
  from deeppavlov.models.kbqa.utils import preprocess_template_queries
label_desc: Use image node_id 1 to create a new TreeToSparql object from inherited base classes: Component with example: obj = TreeToSparql(sparql_queries_filename, syntax_parser, kb_prefixes, adj_to_noun)