Exemple #1
0
def hyperargs():  # type: () -> {}
    """
  Builds different sets of arguments for the classifier.  Must be the same for
  training and predicting.

  :return: the labeled arguments
  :rtype: {}
  """

    retdict = {}

    for curwindow in [128, 64, 32, 256]:
        for curstride in [0.7, 0.8, 0.9]:
            accargs = ClassificationArgs()
            accargs.num_train_epochs = 5
            accargs.fp16 = False
            accargs.overwrite_output_dir = True
            accargs.evaluate_during_training = False
            accargs.sliding_window = True
            accargs.max_seq_length = curwindow
            accargs.stride = curstride
            accargs.labels_list = [1, 0]
            accargs.save_eval_checkpoints = False
            accargs.save_model_every_epoch = False
            accargs.silent = True
            accargs.manual_seed = 18
            retdict['basic5epochs' + str(curwindow) + 'win' +
                    str(int(curstride * 10.0)) + 'stride'] = accargs

    return retdict
Exemple #2
0
def buildbertargs():  # type: () -> ClassificationArgs
    """
  Builds arguments for the classifier.  Must be the same for
  training and predicting.

  :return: the arguments
  :rtype: ClassificationArgs
  """

    accargs = ClassificationArgs()
    accargs.num_train_epochs = 5
    accargs.fp16 = False
    accargs.overwrite_output_dir = True
    accargs.evaluate_during_training = False
    accargs.sliding_window = True
    accargs.max_seq_length = 256
    accargs.stride = 0.9
    accargs.labels_list = [1, 0]
    accargs.save_model_every_epoch = False
    accargs.silent = True
    accargs.manual_seed = 18

    return accargs