Exemple #1
0
def main():
    """Summary
    
    Args:
        study_info_ (StudyInfo): Description
    """
    study_info = StudyInfo("2019 study")
    # plot_all_csv(study_info_)
    #
    initial_test(study_info)
    test_models(study_info)
    test_features(study_info)
    pass
def output_all_polyseme_info():
    """Summary
    :param study_info_:

    Args:
        study_info_ (TYPE): Description
    """
    print("outputting all polyseme info")
    study_info_ = StudyInfo("2019 study")
    all_scenes = study_info_.scene_name_list
    generated_polyseme_models = GeneratePolysemeModels(all_scenes, all_scenes,
                                                       study_info_)

    generated_polyseme_models.distinct_supervised_model.output_polyseme_info()
def output_typicality():
    """Summary
    :param study_info_:
    
    Args:
        study_info_ (TYPE): Description
    """
    print("outputting typicalities")
    s_info = StudyInfo("2019 study")
    all_scenes = s_info.scene_name_list
    generated_polyseme_models = GeneratePolysemeModels(all_scenes, all_scenes,
                                                       s_info)
    p_models = generated_polyseme_models.models
    for model in p_models:

        for preposition in PREPOSITION_LIST:
            model.output_typicalities(preposition)
Exemple #4
0
def get_standard_preposition_parameters(train_scenes):
    model_study_info = StudyInfo("2019 study")
    # scene_list = model_study_info.scene_name_list
    preposition_models_dict = dict()

    features_to_remove = Configuration.object_specific_features.copy()
    # Get parameters for each preposition
    for p in PREPOSITION_LIST:
        M = GeneratePrepositionModelParameters(
            model_study_info,
            p,
            train_scenes,
            features_to_remove=features_to_remove)
        M.work_out_models()
        preposition_models_dict[p] = M

    return preposition_models_dict
Exemple #5
0
        
        Args:
            scene (TYPE): Description
            f (TYPE): Description
            g (TYPE): Description
        
        Returns:
            TYPE: Description
        """
        for i in self.instance_list:
            if i.configuration_match([scene, f, g]):
                return i


if __name__ == '__main__':
    study_info = StudyInfo("2019 study")

    # First preprocess features
    preprocess_features.process_all_features(study_info)

    ### Semantic Annotations
    ### Collect annotation instances and attach values to them
    svcollection = SemanticCollection(study_info)

    svcollection.write_preposition_stats_csvs()
    svcollection.write_config_ratios()

    #### Comparative Annotations

    compcollection = ComparativeCollection(study_info)
"""Summary
Contains Features class which, for a given study, reads file of extracted features, removes some features,
gets average location control, standardises values and outputs
"""

from data_import import StudyInfo


def process_all_features(study):
    """Summary
    """

    f = study.feature_processor
    nd = f.standardise_values()
    f.write_new(nd)
    f.write_mean_std()


if __name__ == '__main__':
    process_all_features(StudyInfo("2019 study"))
    process_all_features(StudyInfo("2020 study"))