Example #1
0
def compute_rouge():
    rouge_parmas = {
        'text_dp': text_dp,
        'ref_dp': path_parser.data_tdqfs_summary_targets,
        'length': 250,
    }
    output = rouge.compute_rouge_for_tdqfs(**rouge_parmas)
    return output
Example #2
0
def compute_rouge_for_oracle():
    """
        The rec dp for oracle saves text for comparing against refecence.

    :return:
    """
    ir_rec_dp = join(path_parser.summary_rank,
                     ir_config.IR_RECORDS_DIR_NAME_TF)
    rouge_parmas = {
        'text_dp': ir_rec_dp,
        'ref_dp': summary_target_dp,
    }
    if centrality_config.LENGTH_BUDGET_TUPLE[0] == 'nw':
        rouge_parmas['length'] = centrality_config.LENGTH_BUDGET_TUPLE[1]

    output = rouge.compute_rouge_for_tdqfs(**rouge_parmas)
    return output
Example #3
0
def compute_rouge_tdqfs():
    text_params = {
        'model_name': qa_config.QA_MODEL_NAME_BERT,
        'length_budget_tuple': ('nw', 250),
        'cos_threshold': 0.6,  # do not pos cosine similarity criterion?
    }
    text_dp = tools.get_text_dp_for_tdqfs(**text_params)

    rouge_parmas = {
        'text_dp': text_dp,
        'ref_dp': tdqfs_summary_target_dp,
    }
    if centrality_config.LENGTH_BUDGET_TUPLE[0] == 'nw':
        rouge_parmas['length'] = centrality_config.LENGTH_BUDGET_TUPLE[1]

    output = rouge.compute_rouge_for_tdqfs(**rouge_parmas)
    return output
Example #4
0
def compute_rouge_tdqfs(length):
    text_params = {
        'model_name': MODEL_NAME,
        'length_budget_tuple': LENGTH_BUDGET_TUPLE,
        'cos_threshold': COS_THRESHOLD,
    }

    text_dp = get_text_dp_for_tdqfs(**text_params)

    rouge_parmas = {
        'text_dp': text_dp,
        'ref_dp': tdqfs_summary_target_dp,
    }
    if LENGTH_BUDGET_TUPLE[0] == 'nw':
        rouge_parmas['length'] = LENGTH_BUDGET_TUPLE[1]
    
    output = rouge.compute_rouge_for_tdqfs(**rouge_parmas)
    return output
def compute_rouge_tdqfs():
    text_params = {
        'model_name': model_name,
        'n_iter': None,
        'length_budget_tuple': centrality_config.LENGTH_BUDGET_TUPLE,
        'diversity_param_tuple': centrality_config.DIVERSITY_PARAM_TUPLE,
        'cos_threshold': centrality_config.COS_THRESHOLD,
        'extra': None,
    }
    text_dp = get_text_dp_for_tdqfs(**text_params)

    rouge_parmas = {
        'text_dp': text_dp,
        'ref_dp': tdqfs_summary_target_dp,
    }
    if centrality_config.LENGTH_BUDGET_TUPLE[0] == 'nw':
        rouge_parmas['length'] = centrality_config.LENGTH_BUDGET_TUPLE[1]

    output = rouge.compute_rouge_for_tdqfs(**rouge_parmas)
    return output