def _get_tars_formatted_sentences(self, sentences: List[Sentence]):
    label_text_pairs = []
    all_labels = [label.decode('utf-8') for label in self.get_current_label_dictionary().idx2item]
    for sentence in sentences:
        label_text_pairs_for_sentence = []
        if (self.training and (self.num_negative_labels_to_sample is not None)):
            positive_labels = list(OrderedDict.fromkeys([label.value for label in sentence.get_labels(self.label_type)]))
            sampled_negative_labels = self._get_nearest_labels_for(positive_labels)
            for label in positive_labels:
                label_text_pairs_for_sentence.append(self._get_tars_formatted_sentence(label, sentence))
            for label in sampled_negative_labels:
                label_text_pairs_for_sentence.append(self._get_tars_formatted_sentence(label, sentence))
        else:
            for label in all_labels:
                label_text_pairs_for_sentence.append(self._get_tars_formatted_sentence(label, sentence))
        label_text_pairs.extend(label_text_pairs_for_sentence)
    return label_text_pairs
def _get_tars_formatted_sentences(self, sentences: List[Sentence]):
    label_text_pairs = []
    all_labels = [label.decode('utf-8') for label in self.get_current_label_dictionary().idx2item]
    for sentence in sentences:
        label_text_pairs_for_sentence = []
        if (self.training and (self.num_negative_labels_to_sample is not None)):
            positive_labels = list(OrderedDict.fromkeys([label.value for label in sentence.get_labels(self.label_type)]))
            sampled_negative_labels = self._get_nearest_labels_for(positive_labels)
            for label in positive_labels:
                label_text_pairs_for_sentence.append(self._get_tars_formatted_sentence(label, sentence))
            for label in sampled_negative_labels:
                label_text_pairs_for_sentence.append(self._get_tars_formatted_sentence(label, sentence))
        else:
            for label in all_labels:
                label_text_pairs_for_sentence.append(self._get_tars_formatted_sentence(label, sentence))
        label_text_pairs.extend(label_text_pairs_for_sentence)
    return label_text_pairs