def __init__(self, task_name: Optional[str]=None, label_dictionary: Optional[Dictionary]=None, label_type: Optional[str]=None, embeddings: Union[(TransformerWordEmbeddings, str)]='bert-base-uncased', num_negative_labels_to_sample: int=2, prefix: bool=True, **tagger_args):
    "\n        Initializes a TextClassifier\n        :param task_name: a string depicting the name of the task\n        :param label_dictionary: dictionary of labels you want to predict\n        :param embeddings: name of the pre-trained transformer model e.g.,\n        'bert-base-uncased' etc\n        :param num_negative_labels_to_sample: number of negative labels to sample for each\n        positive labels against a sentence during training. Defaults to 2 negative\n        labels for each positive label. The model would sample all the negative labels\n        if None is passed. That slows down the training considerably.\n        "
    super(TARSTagger, self).__init__()
    if isinstance(embeddings, str):
        embeddings = TransformerWordEmbeddings(model=embeddings, fine_tune=True, layers='-1', layer_mean=False)
    tars_dictionary = Dictionary(add_unk=False)
    tars_dictionary.add_item('entity')
    tars_dictionary.span_labels = True
    self.tars_model: SequenceTagger = SequenceTagger(hidden_size=123, embeddings=embeddings, tag_dictionary=tars_dictionary, tag_type=self.static_label_type, use_crf=False, use_rnn=False, reproject_embeddings=False, **tagger_args)
    self.separator = str(self.tars_embeddings.tokenizer.sep_token)
    if self.tars_embeddings.tokenizer._bos_token:
        self.separator += str(self.tars_embeddings.tokenizer.bos_token)
    self.prefix = prefix
    self.num_negative_labels_to_sample = num_negative_labels_to_sample
    if (task_name and label_dictionary and label_type):
        self.add_and_switch_to_new_task(task_name, label_dictionary, label_type)
    else:
        log.info('TARS initialized without a task. You need to call .add_and_switch_to_new_task() before training this model')
Initializes a TextClassifier
:param task_name: a string depicting the name of the task
:param label_dictionary: dictionary of labels you want to predict
:param embeddings: name of the pre-trained transformer model e.g.,
'bert-base-uncased' etc
:param num_negative_labels_to_sample: number of negative labels to sample for each
positive labels against a sentence during training. Defaults to 2 negative
labels for each positive label. The model would sample all the negative labels
if None is passed. That slows down the training considerably.
def __init__(self, task_name: Optional[str]=None, label_dictionary: Optional[Dictionary]=None, label_type: Optional[str]=None, embeddings: Union[(TransformerWordEmbeddings, str)]='bert-base-uncased', num_negative_labels_to_sample: int=2, prefix: bool=True, **tagger_args):
    "\n        Initializes a TextClassifier\n        :param task_name: a string depicting the name of the task\n        :param label_dictionary: dictionary of labels you want to predict\n        :param embeddings: name of the pre-trained transformer model e.g.,\n        'bert-base-uncased' etc\n        :param num_negative_labels_to_sample: number of negative labels to sample for each\n        positive labels against a sentence during training. Defaults to 2 negative\n        labels for each positive label. The model would sample all the negative labels\n        if None is passed. That slows down the training considerably.\n        "
    super(TARSTagger, self).__init__()
    if isinstance(embeddings, str):
        embeddings = TransformerWordEmbeddings(model=embeddings, fine_tune=True, layers='-1', layer_mean=False)
    tars_dictionary = Dictionary(add_unk=False)
    tars_dictionary.add_item('entity')
    tars_dictionary.span_labels = True
    self.tars_model: SequenceTagger = SequenceTagger(hidden_size=123, embeddings=embeddings, tag_dictionary=tars_dictionary, tag_type=self.static_label_type, use_crf=False, use_rnn=False, reproject_embeddings=False, **tagger_args)
    self.separator = str(self.tars_embeddings.tokenizer.sep_token)
    if self.tars_embeddings.tokenizer._bos_token:
        self.separator += str(self.tars_embeddings.tokenizer.bos_token)
    self.prefix = prefix
    self.num_negative_labels_to_sample = num_negative_labels_to_sample
    if (task_name and label_dictionary and label_type):
        self.add_and_switch_to_new_task(task_name, label_dictionary, label_type)
    else:
        log.info('TARS initialized without a task. You need to call .add_and_switch_to_new_task() before training this model')