コード例 #1
0
    # if getting accentedness predictions
    # summary_y_values = modeler.get_ys_dict("../../SJP_JC_Audio/perception_results/accented_avgs.csv",
    #                                     speaker_list)

    # if getting fluency predictions
    # summary_y_values = modeler.get_ys_dict("../../SJP_JC_Audio/perception_results/fluency_avgs.csv",
    #                                        speaker_list)

    # if getting comprehensibility predictions
    # summary_y_values = modeler.get_ys_dict("../../SJP_JC_Audio/perception_results/comp_avgs.csv",
    #                                        speaker_list)

    summary_y_values = modeler.get_ys_dict(fpath, speaker_list)

    # zip x and y data
    summary_zipped = modeler.zip_feats_and_ys(phono_feats, summary_y_values)

    # test to make sure this worked
    unzipped_summary_feats, unzipped_summary_ys = zip(*summary_zipped)

    # set variables for input into model
    unzipped_summary_ys = list(unzipped_summary_ys)
    unzipped_summary_feats = np.array(list(unzipped_summary_feats))
    summary_shape = unzipped_summary_feats.shape

    # create instance of class AdaptiveModel
    sum_adapt = modeler.AdaptiveModel(unzipped_summary_feats,
                                      unzipped_summary_ys, summary_shape,
                                      "../../SJP_JC_Audio/phonological_test")

    # split data into datasets
コード例 #2
0
        "S02", "S03", "S04", "S05", "S07", "S08", "S09", "S19", "S21", "S22",
        "S23", "S24", "S25", "S26", "S28"
    ]

    types = [
        "../../SJP_JC_Audio/perception_results/accented_avgs.csv",
        "../../SJP_JC_Audio/perception_results/fluency_avgs.csv",
        "../../SJP_JC_Audio/perception_results/comp_avgs.csv"
    ]

    for fpath in types:
        # read in y data
        summary_y_values = modeler.get_ys_dict(fpath, speaker_list)

        # zip x and y data
        summary_zipped = modeler.zip_feats_and_ys(summary_features,
                                                  summary_y_values)

        # test to make sure this worked
        unzipped_summary_feats, unzipped_summary_ys = zip(*summary_zipped)

        # set variables for input into model
        unzipped_summary_ys = list(unzipped_summary_ys)
        unzipped_summary_feats = np.array(list(unzipped_summary_feats))
        summary_shape = unzipped_summary_feats.shape

        # create instance of class AdaptiveModel
        sum_adapt = modeler.AdaptiveModel(unzipped_summary_feats,
                                          unzipped_summary_ys, summary_shape,
                                          dpath)

        # split data into datasets
コード例 #3
0
           "../data/perception_results/comp_avgs.csv"]

for fpath in y_paths:
    # read in y data
    # accentedness
    y_values = modeler.get_ys_dict(fpath, speaker_list)
    # # fluency
    # y_values = modeler.get_ys_dict("../../SJP_JC_Audio/perception_results/fluency_avgs.csv",
    #                                      speaker_list)
    #
    # # comprehensibility
    # y_values = modeler.get_ys_dict("../../SJP_JC_Audio/perception_results/comp_avgs.csv",
    #                                      speaker_list)

    # zip x and y data
    zipped = modeler.zip_feats_and_ys(acoustic_features, y_values)

    # test to make sure this worked
    unzipped_feats, unzipped_ys = zip(*zipped)

    # set variables for input into model
    unzipped_ys = list(unzipped_ys)
    unzipped_feats = np.array(list(unzipped_feats))
    shape = unzipped_feats.shape

    # create instance of class AdaptiveModel
    adapt = modeler.AdaptiveModel(unzipped_feats, unzipped_ys, shape, "../audio/IS09_summary")

    # split data into datasets
    cv_data, cv_ys = adapt.split_data_for_cv(k=10)