def get_fasttext_train_calls(train_file_path, param_dict, fasttext_path,
    model_path, thread=1, pretrained_vectors_path=None):
    """
    Generates fastText command-line calls for training a supervised model and for compressing the output model.

    :param train_file_path: path to the training dataset
    :param param_dict: dictionary mapping fasttext hyperparameters to their values
    :param fasttext_path: path to the fastText executable
    :param model_path: str, path to output model
    :param thread: int, the number of threads to use
    :param pretrained_vectors_path: str, path to pre-trained `.vec` file with word embeddings
    :return tuple of str - fastText calls for training and quantizing
    """
    train_args = []
    for arg in sorted(param_dict.keys()):
        val = param_dict[arg]
        train_args += [arg, str(val)]
    train_call = [fasttext_path, 'supervised', '-input', train_file_path,
        '-output', model_path]
    train_call += train_args
    train_call += ['-thread', str(thread)]
    if pretrained_vectors_path is not None:
        train_call += ['-pretrainedVectors', pretrained_vectors_path]
    compress_call = [fasttext_path, 'quantize', '-input', model_path,
        '-output', model_path]
    return train_call, compress_call
