def __init__(
            self,
            load_path: str,
            entity_ranker=None,
            entities_database_filename: str = None,
            words_dict_filename: str = None,
            ngrams_matrix_filename: str = None,
            num_entities_for_bert_ranking: int = 50,
            num_entities_for_conn_ranking: int = 5,
            num_entities_to_return: int = 10,
            max_text_len: int = 300,
            max_paragraph_len: int = 150,
            lang: str = "ru",
            use_descriptions: bool = True,
            alias_coef: float = 1.1,
            use_tags: bool = False,
            lemmatize: bool = False,
            full_paragraph: bool = False,
            use_connections: bool = False,
            kb_filename: str = None,
            prefixes: Dict[str, Any] = None,
            **kwargs,
    ) -> None:
        """

        Args:
            load_path: path to folder with inverted index files
            entity_ranker: component deeppavlov.models.kbqa.rel_ranking_bert
            entities_database_filename: filename with database with entities index
            words_dict_filename: filename with words and corresponding tags
            ngrams_matrix_filename: filename with char tfidf matrix
            num_entities_for_bert_ranking: number of candidate entities for BERT ranking using description and context
            num_entities_for_conn_ranking: number of candidate entities for ranking using connections in the knowledge
                graph
            num_entities_to_return: number of candidate entities for the substring which are returned
            max_text_len: maximal length of entity context
            max_paragraph_len: maximal length of context paragraphs
            lang: russian or english
            use_description: whether to perform entity ranking by context and description
            alias_coef: coefficient which is multiplied by the substring matching confidence if the substring is the
                title of the entity
            use_tags: whether to filter candidate entities by tags
            lemmatize: whether to lemmatize tokens
            full_paragraph: whether to use full paragraph for entity context
            use_connections: whether to rank entities by connections in the knowledge graph
            kb_filename: filename with the knowledge base in HDT format
            prefixes: entity and title prefixes
            **kwargs:
        """
        super().__init__(save_path=None, load_path=load_path)
        self.lemmatize = lemmatize
        self.num_entities_for_bert_ranking = num_entities_for_bert_ranking
        self.num_entities_for_conn_ranking = num_entities_for_conn_ranking
        self.entity_ranker = entity_ranker
        self.entities_database_filename = entities_database_filename
        self.num_entities_to_return = num_entities_to_return
        self.max_text_len = max_text_len
        self.max_paragraph_len = max_paragraph_len
        self.lang = f"@{lang}"
        if self.lang == "@en":
            self.stopwords = set(stopwords.words("english"))
            self.nlp = spacy.load("en_core_web_sm")
        elif self.lang == "@ru":
            self.stopwords = set(stopwords.words("russian"))
            self.nlp = spacy.load("ru_core_news_sm")
        self.alias_coef = alias_coef
        self.use_descriptions = use_descriptions
        self.use_connections = use_connections
        self.use_tags = use_tags
        self.full_paragraph = full_paragraph
        self.re_tokenizer = re.compile(r"[\w']+|[^\w ]")
        self.related_tags = {
            "loc": ["gpe", "country", "city", "us_state", "river"],
            "gpe": ["loc", "country", "city", "us_state"],
            "work_of_art": ["product", "law"],
            "product": ["work_of_art"],
            "law": ["work_of_art"],
            "org": ["fac", "business"],
            "business": ["org"]
        }
        self.word_searcher = None
        if words_dict_filename:
            self.word_searcher = WordSearcher(words_dict_filename, ngrams_matrix_filename, self.lang)
        self.kb_filename = kb_filename
        self.prefixes = prefixes
        self.load()


        Args:
            load_path: path to folder with inverted index files
            entity_ranker: component deeppavlov.models.kbqa.rel_ranking_bert
            entities_database_filename: filename with database with entities index
            words_dict_filename: filename with words and corresponding tags
            ngrams_matrix_filename: filename with char tfidf matrix
            num_entities_for_bert_ranking: number of candidate entities for BERT ranking using description and context
            num_entities_for_conn_ranking: number of candidate entities for ranking using connections in the knowledge
                graph
            num_entities_to_return: number of candidate entities for the substring which are returned
            max_text_len: maximal length of entity context
            max_paragraph_len: maximal length of context paragraphs
            lang: russian or english
            use_description: whether to perform entity ranking by context and description
            alias_coef: coefficient which is multiplied by the substring matching confidence if the substring is the
                title of the entity
            use_tags: whether to filter candidate entities by tags
            lemmatize: whether to lemmatize tokens
            full_paragraph: whether to use full paragraph for entity context
            use_connections: whether to rank entities by connections in the knowledge graph
            kb_filename: filename with the knowledge base in HDT format
            prefixes: entity and title prefixes
            **kwargs:
        
deeppavlov/models/entity_extraction/entity_linking.py