Exemplo n.º 1
0
def paper_runs(embeddings, avg_embeddings):
    import weights as wgts
    for header in HEADERS:
        train, test, dev = load_hannah_split(config.CONNO_DIR,
                                             header,
                                             binarize=True,
                                             remove_neutral=False)
        print("###################################", header,
              "###################################")
        do_weighted_run(train, test, dev, embeddings, avg_embeddings,
                        wgts.metoo_header_to_weights[header],
                        wgts.metoo_header_to_avg_token_weights[header])

    print(
        "################################### Power ###################################"
    )
    train, test, dev = load_power_split(config.POWER_AGENCY)
    do_weighted_run(train, test, dev, embeddings, avg_embeddings,
                    wgts.power_logistic_regression,
                    wgts.power_token_regression)
    majority_class(test, embeddings)

    print(
        "################################### Agency ###################################"
    )
    train, test, dev = load_agency_split(config.POWER_AGENCY)
    do_weighted_run(train, test, dev, embeddings, avg_embeddings,
                    wgts.agency_logistic_regression,
                    wgts.agency_token_regression)
    majority_class(test, embeddings)
Exemplo n.º 2
0
def run_connotation_frames(embeddings, avg_embeddings):
    for header in HEADERS:
        print(header)
        train, test, dev = load_hannah_split(config.CONNO_DIR,
                                             header,
                                             binarize=True,
                                             remove_neutral=False)
        format_runs(embeddings, avg_embeddings, train, test, dev)

    print("Power")
    train, test, dev = load_power_split(config.POWER_AGENCY)
    format_runs(embeddings, avg_embeddings, train, test, dev)
    majority_class(test, embeddings)

    print("Agency")
    train, test, dev = load_agency_split(config.POWER_AGENCY)
    format_runs(embeddings, avg_embeddings, train, test, dev)
    majority_class(test, embeddings)
Exemplo n.º 3
0
def loadAgency():
    return load_agency_split(POWER_AGENCY_DIR)