def _get_tars_formatted_sentence(self, label, sentence):
    original_text = sentence.to_tokenized_string()
    label_text_pair = (f'{label} {self.separator} {original_text}' if self.prefix else f'{original_text} {self.separator} {label}')
    label_length = (0 if (not self.prefix) else (len(label.split(' ')) + len(self.separator.split(' '))))
    tars_sentence = Sentence(label_text_pair, use_tokenizer=False)
    for entity_label in sentence.get_labels(self.label_type):
        if (entity_label.value == label):
            new_span = [tars_sentence.get_token((token.idx + label_length)) for token in entity_label.span]
            tars_sentence.add_complex_label(self.static_label_type, SpanLabel(Span(new_span), value='entity'))
    return tars_sentence
def _get_tars_formatted_sentence(self, label, sentence):
    original_text = sentence.to_tokenized_string()
    label_text_pair = (f'{label} {self.separator} {original_text}' if self.prefix else f'{original_text} {self.separator} {label}')
    label_length = (0 if (not self.prefix) else (len(label.split(' ')) + len(self.separator.split(' '))))
    tars_sentence = Sentence(label_text_pair, use_tokenizer=False)
    for entity_label in sentence.get_labels(self.label_type):
        if (entity_label.value == label):
            new_span = [tars_sentence.get_token((token.idx + label_length)) for token in entity_label.span]
            tars_sentence.add_complex_label(self.static_label_type, SpanLabel(Span(new_span), value='entity'))
    return tars_sentence