def __call__(self, q_vects: Union[csr_matrix, List]) -> Tuple[List[str], List[int]]:
        """Found most similar answer for input vectorized question

        Parameters:
            q_vects: vectorized questions

        Returns:
            Tuple of Answer and Score
        """

        if isinstance(q_vects[0], csr_matrix):
            q_norm = sparse_norm(q_vects)
            if q_norm == 0.0:
                cos_similarities = np.zeros((q_vects.shape[0], self.x_train_features.shape[0]))
            else:
                norm = q_norm * sparse_norm(self.x_train_features, axis=1)
                cos_similarities = np.array(q_vects.dot(self.x_train_features.T).todense())
                cos_similarities = cos_similarities / norm
        elif isinstance(q_vects[0], np.ndarray):
            q_vects = np.array(q_vects)
            self.x_train_features = np.array(self.x_train_features)
            norm = np.linalg.norm(q_vects) * np.linalg.norm(self.x_train_features, axis=1)
            cos_similarities = q_vects.dot(self.x_train_features.T) / norm
        elif q_vects[0] is None:
            cos_similarities = np.zeros(len(self.x_train_features))
        else:
            raise NotImplementedError('Not implemented this type of vectors')

        # get cosine similarity for each class
        y_labels = np.unique(self.y_train)
        labels_scores = np.zeros((len(cos_similarities), len(y_labels)))
        for i, label in enumerate(y_labels):
            labels_scores[:, i] = np.max([cos_similarities[:, i]
                                          for i, value in enumerate(self.y_train) if value == label], axis=0)

        labels_scores_sum = labels_scores.sum(axis=1, keepdims=True)
        labels_scores = np.divide(labels_scores, labels_scores_sum,
                                  out=np.zeros_like(labels_scores), where=(labels_scores_sum != 0))

        answer_ids = np.argsort(labels_scores)[:, -self.top_n:]

        # generate top_n answers and scores
        answers = []
        scores = []
        for i in range(len(answer_ids)):
            answers.extend([y_labels[id] for id in answer_ids[i, ::-1]])
            scores.extend([np.round(labels_scores[i, id], 2) for id in answer_ids[i, ::-1]])

        return answers, scores
Found most similar answer for input vectorized question

        Parameters:
            q_vects: vectorized questions

        Returns:
            Tuple of Answer and Score
        
deeppavlov/models/classifiers/cos_sim_classifier.py